Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.2.2
-
None
-
None
-
Windows 7, Eclipse Juno, Hibernate Validator 5, MySQL
Description
The descirption of Bean Validation mentions:
"Notice the use of the @Valid annotation. ... Referenced entities and collections of entities are validated separately in order to prevent circular validation."
If a referenced entity contains a constraint (e.g. @NotNull) and the owner class which references the entity does not use the @Valid constraint, the entity is validated (which is correct) but does throw a PersistenceException containing a ConstraintViolationException and not directly a ConstraintViolationException. Is this behaviour correct according to the spec?
Futhermore, the embedded entities are validated independent of a @Valid annotation, this is not correct.