• +91 9723535972
  • info@interviewmaterial.com

Hibernate Interview Questions and Answers

Question - What are the states of the object in hibernate?

Answer -

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

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

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners