1.

What are the three states of a persistent entity at a given point in time?

Answer»

Instances may exist in one of the following three states at a given point in time −

  • transient − A new instance of a a persistent class which is not associated with a Session and has no representation in the database and no identifier value is considered transient by Hibernate.

  • persistent − You can make a transient instance persistent by associating it with a Session. A persistent instance has a representation in the database, an identifier value and is associated with a Session.

  • detached − Once we close the Hibernate Session, the persistent instance will become a detached instance.



Discussion

No Comment Found