Difference between save vs persist and saveOrUpdate in Hibernate
Save vs. saveOrUpdate vs. persist in Hibernate What is the difference between save and saveOrUpdate or Difference between save and persist are common interview question in any Hibernate interview, much like the difference between get and load method in Hibernate. Hibernate Session class provides a couple of ways to save an object into the database by methods like save, saveOrUpdate, and persist. You can use either save(), saveOrUpdate() or persist() based upon your requirement for persisting objects into the database. The key thing is that all these objects are used to store data into the database but they also make a transient object persistent in Hibernate. Along with Spring framework Interview questions, Hibernate questions are also quite popular on Java interviews because of its status as leading ORM. It's good to prepare some questions from Hibernate before appearing in any J2EE interviews. One of them is the difference between save, saveOrUpdate and persist , w...