1.

What is the difference between hibernate save () saveOrUpdate () and persist () methods?

Answer»
S.noHibernate Save()SaveorUpdate method()
1.Work to generate a new identifier and then inserting the record into the databaseIt either can UPDATE or INSERT because as per the existence of record.save() method can be FAILED with the PERSISTENCE of the PRIMARY key
2.Used for bringing a transient object to a persisting stateIt can bring both new and existing, i.e., transient and detached into a persistent state or can be said that this method can be used for re-attaching a detached object into Session


Discussion

No Comment Found