save() vs persist()

Difference between save() and persist()

In Hibernate applications, save() method can be used to insert a record into the Database table and it will return Primary Key value of the inserted record.

public Serializable save(Object obj)throws HibernateException

In Hibernate applications, persist() method can be used to insert a record into database table and it will not return any value.

public void persist(Object obj)throws HibernateException
save() vs persist()
Scroll to top