openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Drifter <>
Subject @MappedSuperClass Cause Null Pointer Exception in Class With IdClass
Date Sat, 24 Jan 2009 12:30:22 GMT

Dear All .. 
i have four fieild that exist in all tables ..i want to use
@MapperSuperClass .I test and I found that when there is a extended class
that have IdClass PCEnhancer cuase null pointer exception. I use OpenJPA.1.2
in other cases there is  no problem..... in the following class in
ValuableItemDA  there is no problem and everything work well.. but in
SituationDA that have a IdClass it cause null pointer excpetion.  in
PCEnhancer..i think i should add some extera annotation?but i dont know how
solve the problem...

public abstract class CashBaseEntity extends BaseEntity{
	      private String createUser;
	      private Date createTime;
	      private String updateUser;
	      private Date updateTime;
	      private int version;
//getter setter ....removed ..for short post


@Table (  name = "cc2SITUATION")
public class SituationDA extends CashBaseEntity{
	private String CashBoxPeriodSerial;
	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..

@Table (name = "CF2VLUITEM") 
public class ValuableItemDA extends CashBaseEntity{
    private short Code;

//getter setter removed for short post..


View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message