Difference between save() and saveorupdate() method of hibernate?
Answer / Prem Varddhan
The 'save' method saves a new instance to the database, while the 'saveorupdate' method saves or updates an existing instance depending on whether it is already in the database. If the instance is already associated with a session (managed), saveorupdate() will update the instance; otherwise, it will create a new one.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is @manytoone?
What is the use of @transient annotation?
What is hibernate and spring java?
How to get single record from database using hibernate?
Why orm is required?
What is the java persistence api (jpa)?
What is difference between getcurrentsession () and opensession ()?
How to add Hibernate mapping file in hibernate configuration file?
What is the difference between merge and merge join in ssis?
Define persistent classes.
What are the core interfaces of hibernate?
Does hibernate support nosql?