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

Bean Validation: Referenced entity throws PersistenceException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: validation
    • Labels:
      None
    • Environment:
      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

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

              Dates

              • Created:
                Updated: