Hibernate several object states

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.