Hibernate - What is the difference between merge and update?

What is the difference between merge and update?

update () : When the session does not contain the persistent instance with the same identifier, and if it is sure use update for the data persistence in the hibernate.

merge () : Irrespective of the state of a session, if there is a need to save the modifications at any given time, use merge().

What is the difference between merge and update?

- Update should be used to save the data when the session does not contain an already persistent instance with the same identifier.

- Merge should be used to save the modificatiions at any time without knowing about the state of a session.
Hibernate - What is the advantage of Hibernate over jdbc?
What is the advantage of Hibernate over jdbc? - Hibernate code will work well for all databases, for ex: Oracle,MySQL, etc. where as JDBC is database specific...
Hibernate - Why hibernate is advantageous over Entity Beans & JDBC.
Why hibernate is advantageous over Entity Beans & JDBC - An entity bean always works under the EJB container, which allows reusing of the object external to the container....
Hibernate - Difference between Entity Beans and Hibernate
Difference between Entity Beans and Hibernate - Entity beans are to be implemented by containers, classes, descriptors..
Post your comment