使用JPA编程EJB程序时,异常永远不会满足: ERROR [org.jboss.as.ejb3](默认任务-10)javax.ejb.EJBTransactionRolledbackException:org.hibernate.exception.GenericJDBCException:无法从ResultSet读取实体状态:EntityKey [nju.edu.liushao.cineplex.model。会员#1000001] 22:40:10,896 ERROR [org.jboss.as.ejb3.invocation](默认任务-10)JBAS014134:EJB Invocation在组件MemberDaoImpl上失败,方法public abstract nju.edu.liushao.cineplex.model.Member nju.edu。 liushao.cineplex.dao.MemberDao.find(long):javax.ejb.EJBTransactionRolledbackException:org.hibernate.exception.GenericJDBCException:无法从ResultSet读取实体状态:EntityKey [nju.edu.liushao.cineplex.model.Member#1000001 ]
代码如下: 我的JPA实体:
@Entity
@Table(name="member")
public class Member implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private long id;
private String password;
private String name;
private int age;
private int gender;
//address of the member
private String province;
private String city;
private String location;
//the time when the member register
private Timestamp registeDate;
//balance of the member's account
private float balance;
//the latest time when the member charge his/her account
private Timestamp chargeDate;
//account state of the member,valid/canceled/suspended
private int state;
private int level;
//total points the member get every time he/she participate an activity
private int points;
public Member() {
super();
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public int getGender() {
return gender;
}
public void setGender(int gender) {
this.gender = gender;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public Timestamp getRegisteDate() {
return registeDate;
}
public void setRegisteDate(Timestamp registeDate) {
this.registeDate = registeDate;
}
public float getBalance() {
return balance;
}
public void setBalance(float balance) {
this.balance = balance;
}
public Timestamp getChargeDate() {
return chargeDate;
}
public void setChargeDate(Timestamp chargeDate) {
this.chargeDate = chargeDate;
}
public int getState() {
return state;
}
public void setState(int state) {
this.state = state;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public int getPoints() {
return points;
}
public void setPoints(int points) {
this.points = points;
}
}