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

Unique Constraint on MappedSupperClass causes NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0-beta
    • jpa
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: