bean-validation Questions
5
Solved
I have a specific scenario where I can only check for violation conditions manually, at a later point in the flow.
What I want to do is throw a ConstraintViolationException, and provide a "real" ...
Globose asked 8/4, 2014 at 13:21
3
Solved
I'm using SpringBoot (spring-boot-starter-web 1.5.16.RELEASE) and hibernate-validator 6.0.11.Final in my REST service.
DTO objects annotated with proper validation constrains (UPDATE: I'm using @V...
Anticathexis asked 16/10, 2018 at 17:12
4
I have to update information in my database.
FacadePatient.java class code:
public Patient update(Patient p) {
Patient pat = em.find(Patient.class, p.getPatientId());
p.setPatientPhone(pat.get...
Memorable asked 12/6, 2013 at 20:21
3
Solved
I have a class and using annotation to validate the class properties.
My web page (jsf2.2/primefaces/maven) is multilanguage (DE-utch, FR-rench, IT-alian).
My problem is that the hibernate-valid...
Gusella asked 5/11, 2014 at 16:7
3
Solved
I am trying to use bean validation in Webflux. This is what I have so far:
@PostMapping("contact")
fun create(@RequestBody @Valid contact: Mono<Contact>) : Mono<Contact> {
return cont...
Haber asked 25/1, 2018 at 9:51
3
Solved
I have a simple bean with enum field
public class TestBean{
@Pattern(regexp = "A|B") //does not work
private TestEnum testField;
//getters + setters
}
enum TestEnum{
A, B, C, D
}
I would li...
Sorrel asked 4/5, 2012 at 8:19
3
I have a Spring Boot app that contains an User class - all fields have standard JSR-303 annotations (@NotNull, @Size, etc.) and validation works fine.
However when I add a custom validation to Use...
Gyrostabilizer asked 28/8, 2018 at 22:20
2
I already know how to add annotation based validation on specific attributes in Entity class like :-
public class Person {
@NotNull
private String firstName;
private String lastName;
//......
Linstock asked 1/10, 2015 at 6:50
3
Reading the spec for JSR-303 :
The life cycle of a constraint validation implementation instance is undefined
The initialize method is called by the Bean validation provider prior to any use of th...
Yumuk asked 11/4, 2012 at 14:42
1
Solved
I have this dependency:
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
Which have it's v...
Algesia asked 14/8, 2018 at 0:56
2
Solved
I'm trying to figure out how to validate DTO in my controller
Stack:
Spring boot 1.5.4, Spring Data JPA, Hibernate Validation 5, PostgreSQL
The problem is that I'm still getting exception about m...
Euler asked 15/11, 2017 at 15:28
6
Solved
I know there are non-standard frameworks such as commons-validator, and hibernate validator.
I wanted to know if someone knows an implementation of the official standard.
Kaon asked 6/9, 2009 at 5:46
3
Solved
I am writing code that has explicit call to Bean Validation (JSR-303) something like this:
public class Example {
@DecimalMin(value = "0")
private static final String ANNOTATED = "";
public v...
Madeira asked 14/3, 2013 at 12:49
1
Solved
Is it possible to override the default response POJO of Spring Hibernate validator?
Currently when a validation gets failed then a very big response returned to the client as shown below. But I d...
Performing asked 28/5, 2018 at 18:14
2
Solved
I'm trying to do JSR 303 bean validation with a Spring MVC Controller in WAS 8.5.5.12 Full Profile.
I'm validating just a single @RequestParam, not a full bean:
@RequestMapping(method=RequestMet...
Botfly asked 22/8, 2017 at 13:52
2
Solved
I'm trying to implement some custom validation logic for a Spring Boot endpoint using a combination of JSR-303 Bean Validation API and Spring's Validator.
Based on the Validator class diagram it ap...
Burtis asked 17/8, 2016 at 15:48
1
Solved
what is difference b/w java bean validation 2.0 and hibernate validator.
is both are same or different. because both look like same. can you discuss differences between java bean validation 2.0 and...
Scoville asked 2/4, 2018 at 6:24
2
Solved
I've written a validation annotation implemented by a custom ConstraintValidator. I also want to generate very specific ConstraintViolation objects that use values computed during the validation pr...
Conviction asked 16/5, 2014 at 19:13
2
Solved
How can I set a bean validation constraint that a List should at minimum contain 1 and at maximum contain 10 elements?
None of the following works:
@Min(1)
@Max(10)
@Size(min=1, max=10)
private L...
Corneliuscornell asked 22/5, 2017 at 9:3
2
class User(val name: String)
I know that in constructor will be added this check
Intrinsics.checkParameterIsNotNull(name)
To make sure that name do not store null.
Is there a way to instrumen...
Semantic asked 19/3, 2018 at 10:31
1
For a Java code with the following annotation:
@JsonProperty(value="Contact")
@NotNull(message = "ContactUser or CompanyName is required.")
@Valid
@XmlElements(value = {
@Xm...
Aril asked 16/1, 2018 at 11:2
1
Solved
When using JSR-303 annotations to perform bean validation, what is the difference between annotating the field versus the getter?
Is one approach recommended over the other?
Annotation on field
...
Burg asked 10/1, 2018 at 4:13
1
Solved
I have following class to validate:
@Document(collection = "settings")
public class Settings {
@NotEmpty
private String[] allowableExtensions;
...
@AssertTrue(message = "Each extension must be...
Jammiejammin asked 27/12, 2017 at 16:35
2
Solved
I'm wondering whether it's possible to register new constraint validator of some custom type to a annotation defined by Bean Validation specification.
For example, let's image I have a class that a...
Insight asked 5/12, 2017 at 17:8
1
Solved
I have following model class
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
public class Person {
@Max(value = 10, message = "First name should be smaller than...
Bambi asked 16/10, 2017 at 8:40
© 2022 - 2024 — McMap. All rights reserved.