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

Unique Constraint on MappedSupperClass causes NullPointerException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-beta
    • Component/s: jpa
    • Labels:
      None

      Description

      Defining UniqueConstraint on MappedSuperClass fails with NPE [1]

      @MappedSuperclass
      @Table(uniqueConstraints={@UniqueConstraint(columnNames=

      {"ATTR_NAME", "OWNER"}

      )})
      public abstract class Attribute<T> {

      While it is debatable a @Table annotation is appropriate for @MappedSuperClass, the situation must be detected and warned more gracefully than a NPE.

      Also investigate whether UniqueConstraint on a MappedSuperClass should be supported.

      [1] http://n2.nabble.com/UniqueConstraint-in-a-MappedSuperclass-not-working-tc2633410.html

        Attachments

          Activity

            People

            • Assignee:
              ppoddar@apache.org Pinaki Poddar
              Reporter:
              ppoddar@apache.org Pinaki Poddar
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: