-->
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.  [ 3 posts ] 
Author Message
 Post subject: call to .merge() method returns the object without keys.
PostPosted: Fri Apr 28, 2006 2:33 pm 
Newbie

Joined: Mon Apr 24, 2006 2:01 pm
Posts: 13
Hibernate version: 3.1.3

Before I call .merge (Object) on the session I had all the ID columns populated. But the .merge () method returns the object without any key column values. This happens for the parent and all child objects in the colletion.


Is there a way to aviod this issue? Any workarounds. I don't need to update the object after merge.




THANKS


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 28, 2006 2:42 pm 
Regular
Regular

Joined: Wed Feb 22, 2006 11:28 am
Posts: 65
Location: Santiago, Chile
Hello Friend:

If u see the hibernateĀ“s API document about the method merge(Object) of the class Session, it indicate:

[u]Copy the state of the given object onto the persistent object with the same identifier. If there is no persistent instance currently associated with the session, it will be loaded. Return the persistent instance. If the given instance is unsaved, save a copy of and return it as a newly persistent instance. The given instance does not become associated with the session. This operation cascades to associated instances if the association is mapped with cascade="merge".[/u]

I hope this can help u to solve ur problem.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 28, 2006 2:46 pm 
Newbie

Joined: Mon Apr 24, 2006 2:01 pm
Posts: 13
In my case the object was a pre persisted one. I just want to update it in a new session. Why would it remove the ID column data ....?

THANKS!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.