OpenJPA
  1. OpenJPA
  2. OPENJPA-386

org.apache.openjpa.meta.ClassMetaData.validateAppIdClass() does not take @MappedSuperclass into account

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.7, 1.0.0, 1.0.2, 1.1.0, 1.2.1
    • Fix Version/s: 1.1.1, 1.3.0, 2.0.0-M3
    • Component/s: kernel
    • Labels:
      None
    • Environment:
      BEA WebLogic 10.0 under Windows XP SP1
    • Patch Info:
      Patch Available

      Description

      We have a @MappedSuperclass that is the base for all of our entity bean classes. This class contains the @Version (and @Column for the version field) that all of our entity beans use. But, in ClassMetaData.validateAppIdClass(), if an entity bean class has a superclass, and the entity bean has an @IdClass, it expects that superclass to have an @IdClass also. All of our entity beans have an @IdClass (even if they only have a single part key), but our @MappedSuperclass does not have an @IdClass. This scenario works under JBoss 4.2.0 and Sun AS 9, but produces a NullPointerException in OpenJPA at:

      if (_super != null) {
      // concrete superclass oids must match or be parent of ours
      ClassMetaData sup = getPCSuperclassMetaData();
      if (!sup.getObjectIdType().isAssignableFrom(_objectId)) // <--- NullPointerException here

      1. OPENJPA-386_1.0.x.patch
        11 kB
        Jody Grassel
      2. OPENJPA-386_1.1.x.patch
        12 kB
        Jody Grassel
      3. OPENJPA-386_1.2.x.patch
        9 kB
        Jody Grassel
      4. OPENJPA-386_1.3.x.patch
        9 kB
        Jody Grassel
      5. OPENJPA-386_trunk.patch
        9 kB
        Jody Grassel

        Activity

        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        David Ezzio made changes -
        Fix Version/s 1.1.1 [ 12313177 ]
        Donald Woods made changes -
        Fix Version/s 2.0.0-M3 [ 12314148 ]
        Fix Version/s 2.0.0 [ 12314019 ]
        Affects Version/s 1.2.1 [ 12313328 ]
        Affects Version/s 1.1.0 [ 12312344 ]
        Michael Dick made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.3.0 [ 12313326 ]
        Fix Version/s 2.0.0 [ 12314019 ]
        Resolution Fixed [ 1 ]
        Milosz Tylenda made changes -
        Patch Info [Patch Available]
        Jody Grassel made changes -
        Attachment OPENJPA-386_1.3.x.patch [ 12417325 ]
        Attachment OPENJPA-386_trunk.patch [ 12417326 ]
        Jody Grassel made changes -
        Attachment OPENJPA-386_1.1.x.patch [ 12417323 ]
        Attachment OPENJPA-386_1.2.x.patch [ 12417324 ]
        Attachment OPENJPA-386_1.0.x.patch [ 12417322 ]
        Jody Grassel made changes -
        Assignee Jody Grassel [ fyrewyld ]
        Tamas Sandor made changes -
        Field Original Value New Value
        Affects Version/s 1.0.2 [ 12312846 ]
        Matthew L. Schwickerath created issue -

          People

          • Assignee:
            Jody Grassel
            Reporter:
            Matthew L. Schwickerath
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development