jpa-spec
  1. jpa-spec
  2. JPA_SPEC-34

Add support for JSR303 (Bean validation) annotations.

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Labels:
      None

      Description

      Right now, JPA spec neglect Bean Validation annotations.

      The way it is now we end with duplicated information:

          @Column(nullable = false, length = 200)
          @NotNull
          @Size(min = 4, max = 200)
          private String name;
      

      Would be nice just do:

          @Column
          @NotNull
          @Size(min = 4, max = 200)
          private String name;
      

      and end with same result.

        Activity

        Hide
        c.beikov added a comment -

        I think that this is also related to JPA_SPEC-23
        If a "PhysicalCustomizer" as mentioned in the comments could alter the column definition we could even translate annotations to domain constraints by ourselves. I guess what we really need here is an abstraction that enables us to enrich the meta- and physical model in general.

        Show
        c.beikov added a comment - I think that this is also related to JPA_SPEC-23 If a "PhysicalCustomizer" as mentioned in the comments could alter the column definition we could even translate annotations to domain constraints by ourselves. I guess what we really need here is an abstraction that enables us to enrich the meta- and physical model in general.
        Hide
        ldemichiel added a comment -

        Actually, result is not the same, because Bean Validation will trap the constraint validation before it goes to the database. I think what you may be asking for is integration of Bean Validation constraints into the schema generation facility. There has not been strong support for this, but it is something that we could consider in a future release.

        Show
        ldemichiel added a comment - Actually, result is not the same, because Bean Validation will trap the constraint validation before it goes to the database. I think what you may be asking for is integration of Bean Validation constraints into the schema generation facility. There has not been strong support for this, but it is something that we could consider in a future release.

          People

          • Assignee:
            ldemichiel
            Reporter:
            velobr
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: