bean-validation Questions

2

I am trying to set up Hibernate. But when i try to create my Session Factory, with this code: Configuration configuration = new Configuration(); configuration.configure(); serviceRegistry = new Se...
Tankersley asked 23/6, 2013 at 23:38

2

Solved

Could somebody please explain to me why the JPA supports the double type as a field type, but the bean validation constaints in javax.validation.constraints (i.e. @Min/@Max) do not support it? I kn...
Canada asked 14/9, 2011 at 20:49

2

I guess the answer is no, as all references to Bean Validation in the documentation are related to the server side. Is there any support for Bean Validation on the client's side? So that I can val...
Chincapin asked 31/7, 2019 at 16:37

5

Solved

Is it possible to validate a collection of objects in JSR 303 - Jave Bean Validation where the collection itself does not have any annotations but the elements contained within do? For example, is...
Bicyclic asked 5/11, 2010 at 14:25

5

I've encountered an unexpected behaviour when using dependency injection in a ConstraintValidator which is getting evaluated at class level. Entity class: @Entity @ValidDemoEntity public class De...
Mcquade asked 27/6, 2019 at 13:5

2

Does scala supports JSR-303 validation? If it does - could you please write an example? If it does not - are there workarounds to run JSR-303 validation on scala classes?
Cipher asked 18/6, 2014 at 11:40

3

I have below property in POJO class for DoB. @NotNull(message = "dateOfBirth is required") @JsonDeserialize(using = LocalDateDeserializer.class) LocalDate dateOfBirth; How can I validate...
Hayner asked 5/8, 2019 at 23:6

2

Solved

I am creating a website using Spring MVC and for persistence I am using Spring Data JPA with Hibernate 4 as my JPA provider. Validation is being handled at present with Hibernate Validator. I have ...
Vola asked 25/7, 2014 at 12:26

3

Solved

I am using spring boot, and I have enabled the global method security in WebSecurityConfigurerAdapter by @EnableGlobalMethodSecurity(prePostEnabled = true, order = Ordered.HIGHEST_PRECEDENCE) ...

3

Solved

I can't seem to be able to find a summary that distinguishes the difference between these three annotations.
Anteversion asked 16/6, 2013 at 20:18

2

Solved

I'm trying to validate a bean using custom validator. But the validator needs info that is to be passed to it from the method where validate is invoked. Is there a way to do that? I can't pass it ...
Tacye asked 25/6, 2019 at 17:48

5

Solved

I have Bean validation working nicely in my application. Now I want to check that a new user does not choose a username that has already been chosen. In the actionlistener I have the code that che...
Rockwood asked 5/5, 2011 at 3:12

3

Solved

I am trying to deploy a simple spring boot application that will expose some rest api and I use hibernate entity manager to manipulate entity objects. When I try to deploy this application to Oracl...

4

Solved

Is there a way to implement @NotEmpty hibernate validation without writing custom validation? javax.validation package does not contain this annotation. Only @NotNull. But it does not validate for ...
Photocomposition asked 5/7, 2013 at 5:43

2

Solved

Is it possible to use the Spring validation framework with Spring MVC to validate the presence and value of an HTTP request header?
Messuage asked 19/10, 2009 at 17:48

6

Spring 3.0.2, Hibernate 3.5.0, Hibernate-Validator 4.0.2.GA I am trying to inject Spring dependencies into a ConstraintValidator using: @PersistenceContext private EntityManager entityManager; ...

4

I don't understand why JSR 303 (bean validation) is for the getter methods and not setter? Isn't it more logical to put it under setter method since that is the entry point into a field and validat...
Turkoman asked 8/6, 2011 at 18:52

3

Solved

I've been looking a around for a while now with no luck. I'n not using Spring MVC but still want to use @javax.validation.Valid to enable validation of method arguments. To give an example public ...
Broucek asked 4/2, 2011 at 16:3

2

I would like to treat some fields as Optional, if the value is null or blank don't go with the checks of the other annotated constraints. There is some way to achieve it! Reading this tread Java be...
Burge asked 16/2, 2015 at 16:32

3

Solved

I'm working on a project that uses bean validation (Hibernate Validator 5.1.3.Final). My bean has a attribute with the @Past annotation. @Past(message = "A data deve estar no passado.") private Lo...
Stupefacient asked 15/5, 2015 at 0:51

1

Swagger's code generation for a Spring server has an option called useBeanValidation, but I can't figure out how to use it. I couldn't find any documentation telling me which validations it support...
Finely asked 23/11, 2018 at 9:18

7

What is the best way to perform client-side form validation using Javascript (with minimal code duplication) when using JSR 303 bean validation on the server side? I'm currently using Spring 3 and ...
Ironmonger asked 25/3, 2010 at 8:5

4

Solved

I'm using JAX-RS resources with Bean Validation and integration between these two works as expected. However, the default error messages generated in case of a validation error report parameter na...
Kilauea asked 13/7, 2017 at 16:11

1

I am trying to have constraint validation on the field, which must reject if the input is not an integer. public class ClientTO { private Integer phone_num; // } I tried: 1) @Digits - It does ...
Burns asked 15/11, 2018 at 14:9

3

Solved

I am getting started with bean validation, and I'm trying to compose a constraint. My constraint is to validate a CPF(personal document in Brazil). My constraint is working, but I need the message ...
Lonilonier asked 31/1, 2014 at 17:21

© 2022 - 2024 — McMap. All rights reserved.