Hibernate saveOrUpdate vs update vs save/persist
I am struggling to apprehend the slight differences between the hibernate methods saveOrUpdate - update - save/persist . I know there are some similar questions on the site: What are the differences between the different saving methods in Hibernate? Difference between save and saveOrUpdate method hibernate but having read them, I did not notice an answer covering all the issues coming from using those methods in any case. I would to mention the example I have created to test: I have a table USER with the records: id | company 1 Company1 2 Company2 I execute then the code: Session session =