What is the difference between save() and persist() method in hibernate?



What is the difference between save() and persist() method in hibernate?..

Answer / Deepti Karmakar

The save() method in Hibernate saves an entity to the database and manages its association with the session, while the persist() method only adds the entity to the current session without making it persistent. The latter allows for later saving of the entity (either by calling save() or flushing the session).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Hibernate Interview Questions

List some of the databases supported by hibernate.

1 Answers  


What is cache in hibernate?

1 Answers  


How to get single column from database using hibernate?

1 Answers  


What is the use of session in hibernate?

1 Answers  


What are the advantages of hibernate framework?

1 Answers  


What is hibernate architecture?

1 Answers  


How to create foreign key in hibernate annotation?

1 Answers  


Difference between the first and second level cache in hibernate?

1 Answers  


How to use union all in hibernate query?

1 Answers  


What is jboss hibernate?

1 Answers  


Can we declare entity class as final?

1 Answers  


Is httpsession thread safe?

1 Answers  


Categories