|
Answer» The PERSISTENT class’s instance can be in any one of the three different states. These states are defined with a persistence context. The Hibernate has the FOLLOWING instance states:
• Transient: This instance is never been associated with any one of the persistence process. This does not have persistent IDENTITY like primary key value.
• Persistent: A persistent context is made to associate with the current instance. It has persistent identity like primary key value and a corresponding row of a table in the data base. Hibernate guarantees the persistent identity is equivalent to the java Identity [object], for a PARTICULAR persistence context.
• Detatched: This instance association with a persistence context is only once and the context was CLOSED or serialized to another process. The persistent identity is retained and it can be a corresponding row in a database. The persistent class’s instance can be in any one of the three different states. These states are defined with a persistence context. The Hibernate has the following instance states:
• Transient: This instance is never been associated with any one of the persistence process. This does not have persistent identity like primary key value.
• Persistent: A persistent context is made to associate with the current instance. It has persistent identity like primary key value and a corresponding row of a table in the data base. Hibernate guarantees the persistent identity is equivalent to the java Identity [object], for a particular persistence context.
• Detatched: This instance association with a persistence context is only once and the context was closed or serialized to another process. The persistent identity is retained and it can be a corresponding row in a database.
|