What’s the difference between session.save() and session.saveorupdate() methods in hibernate?
Answer / Rohit Kumar Tyagi
The difference lies in how they handle objects that are already persisted. save() will insert a new object if it's not already saved, while saveorupdate() checks whether an entity is transient or detached before deciding to either insert or update the entity.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is column id?
What is @embeddedid in hibernate?
What is orm in entity framework?
What are extension interfaces?
Which came first jpa or hibernate?
What is callback interface in hibernate?
Is hibernate better than jdbc?
How do you implement one to many relationships in hibernate?
What is native query in hibernate?
Why we use hibernate instead of jdbc?
What is Hibernate Session and how to get it?
How will you integrate hibernate with spring framework?