OpenJPA
  1. OpenJPA
  2. OPENJPA-873

@MappedSuperClass Cause Null Pointer Exception in Class With IdClass

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.0.4, 1.2.2, 1.3.0, 2.0.0-M2
    • Component/s: None
    • Labels:
      None

      Description

      This JIRA is open on behalf of pioneer_ip@yahoo.com.

      @MappedSuperclass
      public abstract class CashBaseEntity extends BaseEntity

      { @Column(name="TRCCRUI") private String createUser; @Column(name="TRCCRTS") private Date createTime; @Column(name="TRCLUUID") private String updateUser; @Column(name="TRCLUTS") private Date updateTime; @Version @Column(name="TRCVER") private int version; //getter setter ....removed ..for short post }

      @Entity
      @Table ( name = "cc2SITUATION")
      @IdClass(SituationDA.SituationId.class)
      public class SituationDA extends CashBaseEntity{

      @Id
      @Column(name="C2008SRL")
      private String CashBoxPeriodSerial;

      @Id
      @Column(name="C2012TYPE")
      private short Type;

      public static class SituationId implements Serializable{
      private static final long serialVersionUID = 1L;
      public String CashBoxPeriodSerial;
      public short Type;

      public SituationId(){

      }

      public boolean equals(Object other){
      if (other instanceof SituationId)

      { final SituationId otherId = (SituationId)other; return ( otherId.CashBoxPeriodSerial.equals(this.CashBoxPeriodSerial) && otherId.Type == this.Type ); }

      return false;
      }

      public int hashCode()

      { return super.hashCode(); }

      }
      //getter setter removed for short post..
      }

      @Entity
      @Table (name = "CF2VLUITEM")
      public class ValuableItemDA extends CashBaseEntity

      { @Id @Column(name="C2001COD") private short Code; //getter setter removed for short post.. }

      Exception in thread "main" java.lang.NullPointerException
      at org.apache.openjpa.meta.ClassMetaData.validateAppIdClass(ClassMetaData.java:1883)
      at org.apache.openjpa.meta.ClassMetaData.validateIdentity(ClassMetaData.java:1840)
      at org.apache.openjpa.meta.ClassMetaData.validateMeta(ClassMetaData.java:1757)
      at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1630)
      at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:717)
      at org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:616)
      at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:541)
      at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:308)
      at org.apache.openjpa.enhance.PCEnhancer.<init>(PCEnhancer.java:249)
      at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4502)
      at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4449)
      at org.apache.openjpa.enhance.PCEnhancer$1.run(PCEnhancer.java:4419)
      at org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:726)
      at org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:716)
      at org.apache.openjpa.enhance.PCEnhancer.run(PCEnhancer.java:4414)
      at org.apache.openjpa.enhance.PCEnhancer.main(PCEnhancer.java:4405)

      1. OPENJPA-873_1.2.x.patch
        15 kB
        Jody Grassel
      2. OPENJPA-873_1.0.x.patch
        14 kB
        Jody Grassel

        Activity

        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Michael Dick made changes -
        Fix Version/s 1.0.4 [ 12313301 ]
        Fix Version/s 1.2.2 [ 12313681 ]
        Jody Grassel made changes -
        Attachment OPENJPA-873_1.2.x.patch [ 12411429 ]
        Jody Grassel made changes -
        Attachment OPENJPA-873_1.0.x.patch [ 12410150 ]
        Fay Wang made changes -
        Resolution Fixed [ 1 ]
        Status Reopened [ 4 ] Resolved [ 5 ]
        Michael Dick made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Assignee Fay Wang [ faywang ]
        Fay Wang made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.0 [ 12313483 ]
        Fix Version/s 1.3.0 [ 12313326 ]
        Fay Wang created issue -

          People

          • Assignee:
            Fay Wang
            Reporter:
            Fay Wang
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development