报错信息:Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.lbs.syebx.common.entities.Jc02#3000551332]
这是由于hibernate在使用find或者get方法查询到一个实体时,你又向这个实体赋值,本例中是jc02,如图
只是在查询出来的时候,加了一句话:hibernate.evict(jc02);
这句话的主要作用是使对象jc02从持久化状态转换为游离状态,然后就能向session中加入新的jc02了。