hibernate3的cascade导致deleted object would be re-saved by cascade与 A collection with cascade="all-dele

我在处理数据库的级联关系时,老是碰到题目中的两个异常:deleted object would be re-saved by cascade和A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance。这两个问题,删除cascade这一项会解决一个问题但是也带来了另一个问题,删除cascade以后呢,就相反,总有问题。后来发现原来是hibernate3不支持cascade=“all-delete-orphan”的值只要把set里面的cascade改成cascade="save-update,delete"就可以了

你可能感兴趣的:(hibernate3的cascade导致deleted object would be re-saved by cascade与 A collection with cascade="all-dele)