【发布时间】:2016-02-10 07:42:12
【问题描述】:
伪代码
@Entity
class User
@Id
....
@ManyToOne
@JoinColumn(name = "ID_TP_CLASS", insertable = false, updatable = false)
protected StudentClass studentCLASS;
....
User user = entity.merge(user);
在此代码之后,用户实例将重置 studentClass 实例。 在合并之前,studentClass 实例充满了值,在合并之后,studentClass 的实例存在,但 studentClass 中的值为 null 谁能解释一下为什么会这样?
【问题讨论】: