I have been trying to execute my validator annotations in specific order using @GroupSequence. The annotations are working according to the specified order but in case the first in priority validator fails, the next in order annotations are not being executed, even for class elements which are only annotated with the latter lower priority validators.
I have tried looking into all other answers including How to validate field level constraint before class level constraint? and Control validation annotations order? but my issue is not covered anywhere.
OrderChecks.class
@GroupSequence({NotNull.class, LengthConstraint.class})
public interface OrderChecks {
}
Pojo.class
@NotNull(groups = NotNull.class)
@LengthConstraint(message = "too long string", groups =
LengthConstraint.class)
private String a;
@LengthConstraint(message = "too long string", groups =
LengthConstraint.class)
private String b;
Because NotNull.class has higher priority, only it is executed for String a which is fine but @LengthConstraint is not getting executed for String b.
Is there any way to set it such that the ordercheck is done on each class element separately ?