-->
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: When do i have to use merge?
PostPosted: Mon May 22, 2006 10:09 am 
Beginner
Beginner

Joined: Fri Sep 02, 2005 3:42 pm
Posts: 32
Hy,

I have a doubt about hibernate. When do i have to use the merge method? I only use update,save, list ... but never merge. Any help is good.

Alberto


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 22, 2006 10:23 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
If you pass an object into a session where a persistent object exists with the same identifier, it will update the persistent object. If the persistent object with the same identifier does not exist, it saves the object.

I don't use it that much either, but it has its uses.

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 22, 2006 10:40 am 
Regular
Regular

Joined: Thu Sep 22, 2005 1:53 pm
Posts: 88
Location: Rio de Janeiro
Take a look ate the documentation:

Automatic state detection

The use of save , update , saveOrUpdate and merge is explained.


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.