From: Aaron D. (JIRA) <no...@at...> - 2006-07-11 12:27:02
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-785?page=comments#action_23594 ] Aaron Digulla commented on HHH-785: ----------------------------------- Note: In HHH-1894, I have a much more simple case which is inside a transation, using non-detached objects and there, it doesn't work as well. A pity. > Persistence through cascading should have higher precedence than orphan-delete > ------------------------------------------------------------------------------ > > Key: HHH-785 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-785 > Project: Hibernate3 > Type: Improvement > Components: core > Versions: 3.1 beta 1 > Reporter: Christian Bauer > > > A typical tree mapped using an adjacency list: > <many-to-one name="parent" cascade="none"/> > <set name="children" cascade="all, delete-orphan"/> > A normal tree operation is moving a node: > a.remove(b); > c.add(b); > This results in an exception, as Hibernate currently rates the delete-orphan as more important and warns that the node would become persistent again through cascading. However, this is the only way to implement relocation of a node in a tree without resorting to complex session coding. I argue that the "delete orphans" guarantee given in the mapping should not have precedence over the the actual non-orphaned persistent state in the Session. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |