Question - When do you use merge() and update() in Hibernate?
Answer -
This is one of the tricky Hibernate Interview Questions asked.
- update(): If you are sure that the Hibernate Session does not contain an already persistent instance with the same id .
- merge(): Helps in merging your modifications at any time without considering the state of the Session.