V: three states of Hibernate
Instantaneous: The Bean object and session, regardless of the database. Before the Save method of the session object is saved.
Persistent state (Managed): The Bean object is related to the session, and there is a corresponding record in the database. After the Save method is saved, before the session object is turned off. The session knows the object changes, and when the object changes, the session can save the data in the database even after the session saves the object. (S.save--àstr.commit-----s.close)
Update Upddate (produces two statements insert and UPDATE statements) when the object changes in this process
The object that updates the update is in a persistent state.
When an object does not know whether it is in a transient state or a managed state, it uses the Saveorupdate state, allowing hibernate to determine if it is in a transient state or a managed state (Hibernate will determine if the object's ID has a value to be saved or updated. If there is a value then the update is saved if it is not, and the ID is shaped to determine whether the ID is 0. Determine whether to save or update. The String type determines whether an empty decision is an update or a save
Persistent state: Session object is closed, regardless of database. With the session after the session is closed like (the corresponding object ID has a value).
The Un-save primary key defaults to sesssion when the value of the saved worth ID is equal to the value of the Un-save declaration and is directly saved when there is no Saveorupdate method.
Three states of Hibernate (children)