When do you use merge() and update() in hibernate?



When do you use merge() and update() in hibernate?..

Answer / Brahmanand Thakur

You use the 'merge' method when you want to merge the changes made to a detached object into the persistent context, or when you want to obtain a managed instance associated with the session. The 'update' method is used for updating an existing record in the database without loading it into the session.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

What is the difference between and merge and update?

1 Answers  


What the three inheritance models are of hibernate?

1 Answers  


How many types of cascade are there in hibernate?

1 Answers  


What is mapping class in hibernate?

1 Answers  


Difference between load and get?

1 Answers  


What is query interface in hibernate?

1 Answers  


Why do we use hibernate?

1 Answers  


How does hibernate save work?

1 Answers  


What are different types of caches available in hibernate?

1 Answers  


Can we use only jpa without hibernate?

1 Answers  


What is an orm tool?

1 Answers  


How to call stored procedure in hibernate with out parameter example?

1 Answers  


Categories