
Update:- if you are sure that the session does not contains an already persistent instance with the same identifier,then use update to save the data in hibernate Merge:-if you want to save your modificatiions at any time with out knowing abot the state of an session, then use merge in hibernate. In the previous articles, we have discussed Hibernate 5 - Save an Entity Example and Hibernate 5 - Persist an Entity Example. In this article, we will create a simple Hibernate application to demonstrate how to save or update an entity in the database using the saveOrUpdate method.
| Update will update the record. Merge also do the same but difference is update raise the error if use record not availale but merge can't instead it will create the record. Check it once. Thankyou | 1 | |||||||||
| By: 0 | ||||||||||
| By: 3 | ||||||||||
| By: 0 | ||||||||||
By:
|

