首页 > Multiple representations of the same entity are being merged.

Multiple representations of the same entity are being merged.

我想这么保存数据:

首先 A a = session.load(A.clss,2);

然后在UI层

B b = new B();
b.setAttribute(a);

最后 回到dao层
session.merge(b).

最后报错,看了hibernate官网也没搞明白。求大神。Multiple representations of the same entity [com.sysu.workflow.entity.FormEntity#4] are being merged.


升级Hibernate 版本 到4.2.15以上,再加上<prop key="hibernate.event.merge.entity_copy_observer">allow</prop>` ,详细请参考:http://thinerzq.me/2016/02/01/Multiple-representations-of-the-same-entity-are-being-merged%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95/

【热门文章】
【热门文章】