Hibernate级联高手帮帮忙啊,感激不尽!
org.springframework.orm.hibernate3.HibernateSystemException: Don't change the reference to a collection with cascade="all-delete-orphan": com.chinasofti.emotion.hrm.entity.Employee.documents; nested exception is org.hibernate.HibernateException: Don't change the reference to a collection with cascade="all-delete-orphan": com.chinasofti.emotion.hrm.entity.Employee.documents
我在employee里有设置一个set
<set name="documents" inverse="true" cascade="all-delete-orphan" >
<key>
<column name="EMPLOYEEID" scale="0" not-null="true" />
</key>
<one-to-many class="com.chinasofti.emotion.hrm.entity.Document" />
</set>
然后我添加employee时,第一次添加没事, 再添加时就抛出以上错误, 而且都不能再添加, 要服务器重启后才能再添加一个, 就是服务器启动一次只能加一个employee,大家帮忙看看怎么解决?? 加那个cascade="all-delete-orphan" 是为了级联删除 把employee删了的时候也能同时删了document
[解决办法]
问题解决了没 吧cascade="all-delete-orphan"改成all能OK么?
[解决办法]
问题解决了没 吧cascade="all-delete-orphan"改成all能OK么?
[解决办法]
或者是saveOrupdate