Four types of object states in Hibernate
Temporary state (transient): Just created with the new statement, it is not persisted, and is not in the sesssion cache. In a temporary state
The Java object is called a temporary object.
Persistent State (persistent): Has been persisted and added to the session's cache. Java objects that are in a persistent state are called
The persisted object.
Delete State (removed): It is no longer in the session's cache, and the session is scheduled to delete it from the database. In the Delete form
The Java object of the state is called the Delete object.
Free State (detached): Has been persisted, but is no longer in the session's cache. A Java object that is in a free state is called a free pair
Like.
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/A6/1A/wKioL1nJEQ6T3OmUAAFkZkYFX8M166.png "title=" o522q [PHCJXQDCC ' Z1) F%a.png "alt=" Wkiol1njeq6t3omuaafkzkyfx8m166.png "/>650" this.width=650; "src=" https://s3.51cto.com/wyfs02/M01/ 07/69/wkiom1njebwrqd6raacw2xiozsi138.png "title=" A) g@zfks58xk% ' 3]p26yz85.png "alt=" Wkiom1njebwrqd6raacw2xiozsi138.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/07/69/wKiom1nJEfLjsQ5yAABU3eYT37Y342.png "title=" 9) { UP2Q4DMVTK ' 2UU) kjwdy.png "alt=" Wkiom1njefljsq5yaabu3eyt37y342.png "/>
In the state of a piece according to the Code breakpoint debug See step GitHub code where the test class executes session.delete or can print out a statement but the database has been deleted
Hibernate several object states