Bean Validation, previously commonly called just "JSR-303", is an annotation based validation framework for javabean properties and parameters of arbitrary methods. Hibernate Validator is the reference implementation and the most widely used one.
Questions tagged [bean-validation]
1913 questions
0
votes
1 answer
Dependency Field validation in Camel?
Apache camel bean validation:
I have one field dependent on another can some one help me how to Validate e.g. If manufacturer field data is SPECIFIC then licensePlate field is mandatory.

Sarada Chelluboyena
- 422
- 3
- 16
0
votes
1 answer
How do you enforce minimum size of a collection in JPA or Hibernate
With an @Entity class containing a field:
@JsonProperty("arrays")
@OneToMany(cascade = CascadeType.ALL)
@JoinColumn(name = "systemID", nullable = true)
private List arrays = null;
That defines a collection. The next step is to enforce…

David Herron
- 898
- 2
- 12
- 22
0
votes
1 answer
Spring boot custom field validation
I am trying to make the following validations:
Checking in an email exists in the database.
Checking in an username exists in the database.
Checking if the password confirmation is entered correctly.
I am using a class for validation.…

Jan Wytze
- 3,307
- 5
- 31
- 51
0
votes
0 answers
@NotNull for date validation in java
I want to validate incoming date format (it should only accept date format) with specific format of (DD/mm/YYYY)
which annotation shall i use to see that date is not null
@NotNull
private Date myDate;

AJEET SINGH
- 11
- 1
- 4
0
votes
0 answers
Validation messages across required fields with converter
I have a form with multiple fields, of which I need one of them required to continue or a group of them. For simplicity, I'll just paste a simpler version of my code here

Nuno Vasconcelos
- 69
- 1
- 7
0
votes
0 answers
Stop some validations at the persist time in Spring
Is there a way to stop some validations to be executed at the time of data persist.
I know about
spring.jpa.properties.javax.persistence.validation.mode=none
but I believe that disables all validations, I just want to disable it for some of the…

Vikash
- 2,046
- 3
- 23
- 30
0
votes
2 answers
Implementation of LocalValidatorFactoryBean other than hibernate-validator?
Do you know an implementation of springframework's LocalValidatorFactoryBean other than hibernate-validator?
We don't want hibernate-validator because it fetches too many dependencies in a small spring-mvc 3 application that doesn't use hibernate.

Philippe Blayo
- 10,610
- 14
- 48
- 65
0
votes
3 answers
@unique constraint with database support in hibernate
I have a spring project and want to enforce uniqueness in the database on a field and get the error message back to the UI.
I have read this SO answer and it makes sense so @Column(unique = true) makes the constraint on the table but doesn't enforce…

Doug Greaney
- 181
- 3
- 17
0
votes
2 answers
javax validation OneOf constraint
Is there an annotation in javax validation, so it should constraint that value is one of predefined values.
Example
@OneOf(values = "12-14m, 16m, 18m")
private String size;

Romper
- 2,009
- 3
- 24
- 43
0
votes
0 answers
Jersey bean validation is not working in weblogic 12c
I'm trying to deploy an application to weblogic and we are using jersey as a jsr 303 bean validation provider
org.glassfish.jersey.ext
jersey-bean-validation
…

Sameh
- 21
- 8
0
votes
1 answer
Hibernate validateValue interaction with value extractor
EDIT: Bug is present in 6.0.1.Final but not 5.4.1.Final. Submitted bug report: https://hibernate.atlassian.net/browse/HV-1471
Hibernate validation is throwing an error when attempting to use the validateValue method
/**
* Validates all constraints…

williameddy
- 3
- 3
0
votes
0 answers
Play! Framework error in custom Constraints.Required validation message
please note: play framework newbie
Intro:
I require custom validation messages, constraints.require Having done some research, I found that using the default:
@Constraints.Required
will show a message error.required which is usually found in…

CybeX
- 2,060
- 3
- 48
- 115
0
votes
1 answer
Configuring custom validation with validator dependancy injection
I'm trying to define constraint definition with Hibernate Validation 6.0.1 where the validator is in a different location (.jar/project) relative to the constraint annotation. Aka, I have my objects that I want to validate that are in the project…

Jean-Sébastien Roy
- 15
- 6
0
votes
1 answer
Empty response body on request validation Error (Apache CXF, JAX-RS)
I am using Apache CXF, JAX-RS and JSR-303 validation.
Validation works properly, for invalid request objects I have HTTP 400 response and validation errrors in logs, but my response body is empty.
How to have details about validation errors in…

Bartosz Bilicki
- 12,599
- 13
- 71
- 113
0
votes
1 answer
@Max does not accept 10 digits on long wrapper type
As part of entity definition, @Max(javax.validation.constraints.Max) won't take upper value to validate a 10 digit integer
@Min(0)
@Max(9999999999)
@Column(name = "some_column", nullable = false,
columnDefinition = "INT(10) NOT NULL")
private…

soufrk
- 825
- 1
- 10
- 24