GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE  >  Hibernate
Go To First  |  Previous Question  |  Next Question 
 Hibernate  |  Question 25 of 33    Print  
What is the difference between and merge and update

  
Total Answers and Comments: 5 Last Update: October 19, 2008     Asked by: rajneeshg 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: talktoudaykumar
 

Update():- if you are sure that the session does not contains an already persistent instance with the same identifier,then use update to save the data in hibernate

Merge():-if you want to save  your modificatiions at any time with out knowing abot the state of an session, then use merge() in hibernate.



Above answer was rated as good by the following members:
srisatishch, manishg80, geeky920, jshreekc
July 24, 2007 09:43:51   #1  
chandra        

RE: What is the difference between and merge and updat...
In COBOL merging means combining records of two or more sequential files. This can be acheived through MERGE VERB. After merging all the records can be stored in seperate output file. In output file all the records are sorted.
Update means we can modify the records of any file. This can be achieved through REWRITE VERB.

 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
April 19, 2008 23:20:36   #2  
rangababu26in Member Since: December 2007   Contribution: 1    

RE: What is the difference between and merge and update
Hi
Merge: merge is like combining records from more than one table(while retreving records from tables baseb on some conditions)


Update: Update is like edit . use to change the valu of record...

 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
June 09, 2008 10:44:34   #3  
talktoudaykumar Member Since: May 2008   Contribution: 2    

RE: What is the difference between and merge and update

Update():- if you are sure that the session does not contains an already persistent instance with the same identifier then use update to save the data in hibernate

Merge():-if you want to save your modificatiions at any time with out knowing abot the state of an session then use merge() in hibernate.


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
August 17, 2008 17:21:57   #4  
omkar5136 Member Since: August 2008   Contribution: 1    

RE: What is the difference between and merge and update

Merge:Suppose if we take two words like.. one is milk two is van
if we merge this two words it forms milkvan.

Update:Means if we have know something about JAVA language there are soo many new things are being added to the java language if we know all or some portion of new things with existing things are taken as update.


 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
October 19, 2008 02:18:19   #5  
promisingram Member Since: October 2008   Contribution: 1    

RE: What is the difference between and merge and update

Use update() if you are sure that the session does not contain an already persistent instance with the same identifier and merge() if you want to merge your modifications at any time without consideration of the state of the session. In other words update() is usually the first method you would call in a fresh session ensuring that reattachment of your detached instances is the first operation that is executed.



 
Is this answer useful? Yes | NoAnswer is useful 3   Answer is not useful 0Overall Rating: +3    


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape