我用兩個表由Hibernate和 我不明白爲什麼對於特定的查詢我有這個問題。 我希望有人認識到這個問題。org.hibernate.type.SerializationException:無法反序列化
我有一個表用戶
@Entity
@Table(name="user")
public class User implements Serializable {
private static final long serialVersionUID = 1L;
private Long idUser;
private Area area;
//...other get and setter
@OneToOne(fetch=FetchType.EAGER)
@JoinColumn(name="idarea")
public Area getArea() {
return area;
}
}
和表格區域
@Entity
@Table(name = "area")
public class Area implements Serializable {
private static final long serialVersionUID = 1L;
@Id @GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="idarea")
private Long idArea;
@Column(name="area_name")
private String areaName;
@Column(name="time_start")
private LocalTime timeStart;
//...other get and setter
}
日誌說:
15:27:28,140 INFO DefaultLoadEventListener:160 - Error performing load command
org.hibernate.type.SerializationException: could not deserialize
at org.hibernate.util.SerializationHelper.doDeserialize(SerializationHelper.java:262)
at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:306)
at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.fromBytes(SerializableTypeDescriptor.java:130)
at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:116)
at
....//other lines
org.springframework.orm.hibernate3.HibernateSystemException: could not deserialize; nested exception is org.hibernate.type.SerializationException: could not deserialize
爲什麼用戶實體中沒有主鍵? – invariant
「用戶」實體中的其他字段的註釋在哪裏? – axtavt
@invariant對不起,我把現在得到改變爲可視化... – Shinigami