-->
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.  [ 2 posts ] 
Author Message
 Post subject: Merging turns association objects from detached into proxy
PostPosted: Mon Nov 05, 2007 10:56 am 
Regular
Regular

Joined: Thu Oct 13, 2005 4:19 am
Posts: 98
I have a detached Person instance, which has a toOne association of a detached House instance.

When I merge my detached Person, I was expecting that all properties are copied into the persistent Person.
Much to my surprise, The House property was changed from the detached House into a proxy of House (with the same id though).

Is there any way to change this behavior and make it copy the detached House instance in the persistent Person?


After the merge, I need to do something with the House property and for performance reasons (this is done in a bulk loop) I don't want to re-select the house.

Thanks for any help.

_________________
http://www.ohloh.net/accounts/ge0ffrey


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 09, 2007 3:50 am 
Regular
Regular

Joined: Thu Oct 13, 2005 4:19 am
Posts: 98
I thought I had a workaround, but it doesn't work:
- get the detached objects before the merge
- merge
- set the detached objects after the merge

however, this seems to lead to more round trips to my database?

_________________
http://www.ohloh.net/accounts/ge0ffrey


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

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.