deleted object would be re-saved by cascade

deleted object would be re-saved by cascade (remove deleted object from associations)这个异常

在Hibernate中,删除存在关联关系的一个对象时,会出现 org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations)

 

解决方案如下:
方法1 删除Set方的cascade
方法2 解决关联关系后,再删除

方法3 在many-to-one方增加cascade 但值不能是none

你可能感兴趣的:(Hibernate)