Difference between save vs persist in Hibernate

By | July 1, 2022

In this post, We will try to understand the difference between save vs persist in Hibernate.

save(obj) persist(ob)
It returns generated id and the return type is serializable It does not return anything. It’s a void return type.
It can save object within boundaries and outside boundaries It can only save object within the transaction boundaries
It is only supported by Hibernate It is also supported by JPA
Save() operation cascades the associated instances if the association is mapped with cascade=”save-update” Persist() operation cascades the associated instances if the association is mapped with cascade=”persist”.
You May Also Like:
That’s all about the difference between save vs persist in Hibernate 

Leave a Reply

Your email address will not be published. Required fields are marked *