以下是我在网上找到的,
我用了第二种方法,奇怪的是:
我在action中没有把少一端集合中去除对象,没报错,
放到service中就报这个异常了。
在Hibernate中,删除存在关联关系的一个对象时,会出现 org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations)这个异常
解决方案如下:
方法1 删除Set方的cascade
方法2 解决关联关系后,再删除 :
Attachment attachment = attachments.get(i);
content.getAttachments().remove(attachment);
attachment.setContent(null);
removeObject(attachment);
方法3 在many-to-one方增加cascade 但值不能是none
如果以上三个方案都失败(哼哼~ 我用了5个小时才找出来的)
检查一下hashCode equals是否使用了id作为唯一标示的选项了;我用uuid.hex时是没有问题的;
但是用了native,就不行了,怎么办?删除啊!
也就是问题出现在本文给出的持久化类的hashCode equals方法身上
分享到:
相关推荐
Exploring the location of object deleted by seam-carving
通过此代码,查看微信被删好友
Multiply deleted [E1, polymerase-, and pTP-] adenovirus vector persists despite deletion of the preterminal protein RESEARCH ARTICLE Multiply deleted [E1, polymerase-, and pTP-] adenovirus vector ...
Alfresco删除的内容商店清洁程序 该加载项提供了一项工作,以删除“已删除的内容存储”中... 该插件将从已删除的内容存储库(通常位于${alfresco}/alf_data/contentstore.deleted ) ${alfresco}/alf_data/contentstore
To be deleted. How to delete this file?
{****************************************************************************** * * ... Gets an indexed child object of the designated object. Parameters: In: inRef - The reference...
Dont Download, it will be deleted
在触发器中,需要用到 SQL Server 的 inserted 和 deleted 两个虚拟表,在执行 sql 命令时,这两个虚拟表分别记录的内容如下: sql命令 deleted inserted ------------------------------------------------...
SQLite-Deleted-Records-Parser, 在SQLite数据库中,用于恢复已经删除项目的脚本 SQLite解析器在SQLite数据库中恢复删除条目并将输出放入TSV文件或者文本文件( R ) 中的脚本sqlparse.py的###Usagesqlparse.py -f/...
*DELETED**DELETED**DELETED*
不幸的是,我以为SF可以完全控制一个人的源代码,但是它不允许,所以回到GitHub的源代码中,它们只会使用SF来托管可下载的版本以及一个主页,或者也许不托管。
- ADD: Add TFlexPanel.InvalidateControl virtual method which calls from TFlexControl.Invalidate and can be overriden (it is possible now to catch all object invalidation calls). - FIX: The TFlexPanel....
语言:English 追踪谁在社交网络上使用谁。 看谁删除/联合您在社交网络上! 谁删除了我跟踪你的朋友列表,并在朋友缺少时通知你。 我们会告诉您是否删除了您或停用。 当你结交新朋友时,我们也会告诉你!
They can be saved to another drive with a few mouseclicks (see Searching deleted files for step by step instructions). Recover4all?only lists folders that contain deleted files. Normal nondeleted ...
that would be deleted. No note is added if a file is not supposed to be removed by Symantec Uninstaller. -f Do not show files as they are removed. If -f is not specified, file names are shown as ...
hibernate.properties # # Hibernate, Relational Persistence for Idiomatic Java # # License: GNU Lesser General Public License (LGPL), version 2.1 or later. # See the lgpl.txt file in the root directory...
xvideos.com-deleted-full.csv.zip
deleted deleted deleted deleted deleted