I have a problem with validation of nested models, look:
class A{
@NotNull
Integer i;
B b;
}
class B{
@NotNull
Integer j;
}
In spring controller:
@Valid @RequestBody...
It properly validate i, but not validate j. How to force Spring to validate arbitraly deep ?
And second thing:
Is it possible to do following validation: Object of class 'A' is proper only and only if exactly one of i an j is null.
class A{
Integer i;
Integer j;
}