I have some constraints in the model class like this:
Code:
public class User{
@NotNull
private String name;
@NotNull(groups=AfieldCheck.class)
private String aField;
@NotNull(groups=AnotherFieldCheck.class)
private String anotherField;
}
the group definition:
Code:
public interface AfieldCheck{}
public interface AnotherFieldCheck extends Default{}
AnotherFieldCheck extends the default validation group so it checks both
name and
anotherField Now I define a group for ordered constraint evaluation
Code:
@GroupSequence({AnotherFieldCheck.class, AfieldCheck.class})
public interface OrderedCheck {}
If I make the below method call:
Code:
validator.validate( user, OrderedChecks.class );
When the validator checks the first group
AnotherFieldCheck.class which extends
Default.class, the field
name of the Default groups it isn't evaluated.
Is it right?