I have a class similar to this:
public Foo {
@Valid
private Bar bar;
private Long barId;
}
so when I validate class Foo, class Bar is validated as well. But sometimes I don't want class Bar to be validated (eg when it's not possible to correct bad values) when I validate Foo. Can I do something similar to this:
@Valid(when="barId is null")
?