Hi,
All hibernate validation seems to happen during the commit. For example suppose I have the POJO:
Code:
public class Person {
private String lastName;
@Length(
min = 0, max = 5, message = "Minimum {min}, maximum {max} characters."
)
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
and my application code is:
Code:
person.setLastName("123456789");
This is allowed, the exception is not thrown until commit is called.
I would have thought it would make more sense to throw an exception earlier?
Comments appreciated