1.

What Are The States Of Object In Hibernate?

Answer»

There are 3 states of OBJECT (instance) in hibernate.

  • Transient: The object is in transient state if it is just CREATED but has no primary key (identifier) and not associated with session.
  • PERSISTENT: The object is in persistent state if session is OPEN, and you just saved the instance in the database or retrieved the instance from the database.
  • Detached: The object is in detached state if session is closed. After detached state, object comes to persistent state if you call lock() or update() method.

There are 3 states of object (instance) in hibernate.



Discussion

No Comment Found