1. Features of the transient status: * No matching data exists in the database. * Not included in session management 2. Features of the persistent state: * Objects in the persistent State have matched data in the database. * Added session management. * When the cache is cleared (dirty data check), it will be synchronized with the database 3. Features of the detached status: * Matched data exists in the database. * Not included in session management Difference between the detached status and the transient status The object in the transient (Free State) State has nothing to do with the records in the database table. You cannot find the corresponding records in the database based on the information in the transient object. Although the detached (Free State) State object is detached from the session instance, it can find the data records corresponding to the table in the database based on the information. For example, if the database table record with the corresponding ID of a table has been deleted, the object has no correspondence with the record in the database table, so it is in the transient state. |
This article is transferred from www.35java.com