-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: EntityNotFoundException merging new graph
PostPosted: Mon Jun 23, 2008 6:14 pm 
Newbie

Joined: Sun Apr 10, 2005 2:20 am
Posts: 15
I am trying to persist a graph of objects that are laid out as follows:

A have a Tree (T) object that owns a collection of Nodes (N). Each node has a collection of child nodes and a reference to a parent node (these are non-containment relationships) forming an hierarchy of nodes.

I basically want to load T and in one swoop all N with N.parent and N.childNodes properly populated forming a tree in memory (as opposed to loading T then the root N then the level 2 Ns, then etc etc)

The problem is that I am trying to merge this graph and even if it is an entirely new graph and doesnt exist in the db I still get an EntityNotFoundException.

After debugging for a bit I noticed that Hibernate is merging T, which in turn is merging T.nodes. Then it tries to merge each Node in T.nodes but barfs when trying to copy references from a Node that has a ref to another one that hasnt been yet copied and its not in the internal cache.

Am I trying to do something that is not supported in Hibernate or should I customize my mapping in such a way that I am able to merge T without issues?

thanks,
-- yuri


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.