adspace
How will you explain save() and saveorupdate() methods in hibernate?
Answer Posted / Kuldeep Shakya
In Hibernate, the 'save()' method is used to persist a new object or update an existing one. If the object is new, it gets inserted into the database; if the object already exists in the database, the changes made to the object will be saved. The 'saveorupdate()' method behaves similarly but avoids duplicate entries by only updating the object if its primary key already exists in the database.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers