Hibernate saveorupdate is not updating
If the primary key already present in the table, it cannot be inserted. based upon your requirement for persisting object into Database.Those of you that have worked with plain Hibernate will probably have grown quite accustomed to using the method figures out whether the object is new or has already been saved before.
The lifecycle of a Session is bounded by the beginning and end of a logical transaction. The persistent state is the state loaded and queried entities are in.We kicked off our hunt for JPA implementation patterns with the Data Access Object pattern and continued with the discussion of how to manage bidirectional associations.Hibernate just holds the state of the new object, loaded object and updated object.