[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2764) EntityType.deepCopy needs to copy for EntityType.DOM4J

John Verhaeg (JIRA) noreply at atlassian.com
Mon Sep 27 10:46:57 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=38515#action_38515 ] 

John Verhaeg commented on HHH-2764:
-----------------------------------

I guess to clarify my previous comment, I was looking at potentially doing another deep copy of the value via the tupilzer, but that would require access to the session as well as the tupilizer itself.

> EntityType.deepCopy needs to copy for EntityType.DOM4J
> ------------------------------------------------------
>
>                 Key: HHH-2764
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2764
>             Project: Hibernate Core
>          Issue Type: Bug
>    Affects Versions: 3.2.2
>         Environment: Hibernate 3.2.2
>            Reporter: Alan Krueger
>
> Using DOM4J with a set of composite-elements that contains a many-to-one.  When loading this from the database, the many-to-one piece of the composite-element is disappearing from the XML.  I can see the collection being built and the properties on the elements of the collection being set, but the many-to-one property disappears after that.
> Investigating this, it looks like when PersistentElementHolder.getSnapshot is called and a deepCopy is performed, the EntityType.deepCopy method returns the value to be copied rather than copying it.  This interacts poorly with the DOM4J tree, since each Element can only have a single Element parent.  When the properties are set on this, a detach is performed that yanks the original element out of its parent.

-- 
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

        


More information about the hibernate-issues mailing list