openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Dick (JIRA)" <j...@apache.org>
Subject [jira] Updated: (OPENJPA-873) @MappedSuperClass Cause Null Pointer Exception in Class With IdClass
Date Mon, 22 Jun 2009 18:06:07 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-873?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael Dick updated OPENJPA-873:
---------------------------------

    Fix Version/s: 1.2.2
                   1.0.4

Applied patches for 1.0.x and 1.2.x. 

> @MappedSuperClass Cause Null Pointer Exception in Class With IdClass
> --------------------------------------------------------------------
>
>                 Key: OPENJPA-873
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-873
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>            Reporter: Fay Wang
>            Assignee: Fay Wang
>             Fix For: 1.0.4, 1.2.2, 1.3.0, 2.0.0-M2
>
>         Attachments: OPENJPA-873_1.0.x.patch, OPENJPA-873_1.2.x.patch
>
>
> 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)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message