Hibernate session method to update object
- by EugeneP
I need this roadmap of a Hibernate managed object instance.
First, I create an instance with initial properties and persist this object in a db.
Then session associated with this object is closed.
But still, I serialize my object and on the next step deserialize it, invoke some setters,
and again, I need to update what changed in a database.
What methods of Hibernate session should I use?
persist() or save() on the first step and saveOrUpdate() on the second?
In fact I see that saveOrUpdate() can be used on each step.
What would you recommend?