Hi, Hardy
Thanks for the reply. The Info class has a begin date and an end date in it, and the class has an @AssertTrue annotation which requires the begin date to be before the end date (if the two dates are not null).
In class A, I use it like this:
Code:
@Entity
public class A {
...
@Embedded
@Valid
private Info info;
...
}
In class B, I also use Info as an embedded object and I want to add a constraint: that the begin date is not null. My question is: can I add this constraint to class B?
I think you're suggesting that in the Info class itself (rather than in class B), I add a @NotNull constraint to the begin date field, but tag it with a non-null group name so I turn the not-null validation on and off?
Does that sound right?