What is difference between save and persist method in hibernate?
Answer / Vivek Kumar
The 'save' method in Hibernate is deprecated since Hibernate 4.0. It performs both insert and update operations based on the current state of the entity instance. On the other hand, the 'persist' method only adds an entity to the persistence context without performing any database operation, leaving the actual insert operation for later when transaction commits.
| Is This Answer Correct ? | 0 Yes | 0 No |
How transaction management works in Hibernate?
What is flush in hibernate?
Why do you use hibernate?
What is the use of session in hibernate?
Why is hibernate preferred over jdbc?
How to make a immutable class in hibernate?
What is the need for hibernating tools when orm tools can be used?
What are the two types of collections in hibernate?
What is hql in hadoop?
What do you mean by named – sql query?
Does hibernate work without primary key?
Why session is not thread safe in hibernate?