Besides primitive types and String none of the fields of my "Declaration" entity can be validated. They're all ignored by the validator.
I've got 3 issues here.
The entity was previously loaded and cached by Hibernate. I guess it is proxied but somehow Hibernate.isInitalized(declaration.getChildren()) returns true.
Entities in a relationship with the "Declaration" entity are not validated.
From the entity point of view all relationships are eager. If the entity is proxied, I thought it would be validable using an "always-yes" TraversableResolver. However it doesn't work.
Embedded objects are not validated.
I didn't expect a proxy to restrict the access to those fields either.
What is happening ?
Some kind of byte code manipulation occurs but I didn't enable byte code enhancement.
> When lazy loaded associations are supposed to be validated it is recommended to place the constraint on the getter of the association.
This solves my issue but I didn't expect it to work that way.
Could it be possible for a properly-configured TraversableResolver to navigate through @Valid fields even if they are embedded.
If my expectations are wrong, could someone please point me to the truth ?
Spring Boot 2.1.7
Hibernate ORM 5.3.10
Hibernate validator 6.0.17