What is the difference between merge and update method?
Answer / Avanish Kumar
In Hibernate, the merge() method merges a detached object (not associated with any Session) into the persistence context. If the object already exists in the database, the changes made to the detached object are applied, otherwise a new object is created and saved. The update() method, on the other hand, updates an existing persistent object without checking if it's associated with a current Hibernate Session.
| Is This Answer Correct ? | 0 Yes | 0 No |
Difference between load and get?
What are the core interfaces of hibernate?
How can the primary key be created by using hibernate?
What inheritance mapping strategies are available in hibernate?
What is criteria in hibernate?
What is disadvantage of hibernate?
What is collection mapping?
What is dialect in hibernate?
Which annotation is used to auto generate primary key?
What is the role of session interface in hibernate?
How does hibernate mapping work?
What is the difference between and merge and update?