What is difference between update and merge in hibernate?



What is difference between update and merge in hibernate?..

Answer / Saurab Kumar Verma

Update in Hibernate updates an existing entity instance based on its primary key, while Merge checks if an entity with the same primary key already exists. If it does, it merges the changes of the passed-in transient entity into the persistent entity.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

Can we use multiple database in hibernate?

1 Answers  


Why use hibernate framework?

1 Answers  


Does hibernate work with nosql?

1 Answers  


What are the different types of extension interface that is present in hibernate?

1 Answers  


Define cascade and inverse option in one-many mapping?

1 Answers  


What are the advantages of Hibernate over JDBC?

1 Answers  


What does hibernate.properties file consist of?

1 Answers  


What is cascadetype in hibernate annotations?

1 Answers  


How can we bind hibernate session factory to JNDI ?

1 Answers  


Difference between save() and saveorupdate() in hibernate?

1 Answers  


What are the Collection types in Hibernate?

1 Answers  


What is lazy loading in hibernate and how is it done?

1 Answers  


Categories