Java Bean Validation: GroupSequence with Class-Level Constraint

mnm

New Member
I have a bean class with multiple (custom) inner constraints and one class-level constraint. I'd like to validate the inner constraints before the class-level constraint. The code looks like this:\[code\]@GroupSequence({ Inner.class, NewSlotBean.class })@TotalBeanValid(groups = NewSlotBean.class)public class NewSlotBean { @DayMonthYearString(groups = Inner.class) private String slotDay; @TimeString(groups = Inner.class) private String slotBegin; @LengthString(groups = Inner.class) private String slotLength;}\[/code\](\[code\]Inner\[/code\] is just an empty interface lying around somewhere).However, when I try to run this, the class-level constraint does not get validated at all. When I try to define the GroupSequence like\[code\]@GroupSequence({ Inner.class, Outer.class })\[/code\](with \[code\]Outer\[/code\] being a random interface), I get the exception: \[code\]javax.validation.GroupDefinitionException: ...*.beans.NewSlotBean must be part of the redefined default group sequence.\[/code\]Does s/o know how to make sure that the class-level constraint is validated after the inner ones? (This appears not to be the default! I've had random problems with it popping up after a while.)
 
Back
Top