Hibernate (Java) Question:

What is the difference between and merge and update?

Tweet Share WhatsApp

Answer:

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.

Download Hibernate PDF Read All 52 Hibernate Questions
Previous QuestionNext Question
What is the difference between load() and get()?How do you define sequence generated primary key in hibernate?