hardy.ferentschik wrote:
I don't understand - this is exactly what it does. A group sequence is an ordered validation.
Yes, a group sequence is an ordered validation, it seems the sequence is relative to the group of other properties in an object. What I mean by this is per the following example:
Code:
@NotEmpty(groups=First.class)
@Size.List( { @Size(min = 8, groups=Second.class), @Size(max = 32, groups=Second.class) })
@Pattern(regexp="[a-zA-Z ]+", groups=Third.class)
private String name;
@NotEmpty(groups=First.class)
@Email(groups=Second.class)
private String email;
If:
Code:
name = "";
email = "xyz";
The validator would return just one error message, but in fact, it should return two error messages. One for name (@NotEmpty of First.class group) and one for email (since @Email in Second.class group). Currently, Hibernate Validator returns just one error for @NotEmpty of the name property.
I thought ordered constraint validation, would mean the validator would execute the constraints of the property in the ordered they were defined by the group(s) of that property only.