1.

What’s The Difference Between Session.save() And Session.saveorupdate() Methods In Hibernate?

Answer»

Sessionsave() method SAVES a RECORD only if it’s unique with RESPECT to its primary key and will FAIL to insert if primary key already EXISTS in the table.
saveOrUpdate() method inserts a new record if primary key is unique and will update an existing record if primary key exists in the table already.

Sessionsave() method saves a record only if it’s unique with respect to its primary key and will fail to insert if primary key already exists in the table.
saveOrUpdate() method inserts a new record if primary key is unique and will update an existing record if primary key exists in the table already.



Discussion

No Comment Found