Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2398

Bean Validation: Referenced entity throws PersistenceException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.2.2
    • None
    • validation
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            oprobst Oliver Probst
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: