Explain the types of Hibernate instance states.- 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:
1. Transient : This instance is never been associated with any one of the persistence process. This does not have persistent identity like primary key value.
2. 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
3. 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.Explain the types of Hibernate instance states.- Three types of instance states:
1. Transient :In this state, an instance is not associated with any persistence context.
2. Persistent :In this state, an instance is associated with a persistence context.
3. Detached :This is a state for an instance which was previously associated with a persistence context an has been currently closed dissociated.
|