• +91 9723535972
  • info@interviewmaterial.com

Hibernate Interview Questions and Answers

Question - Difference between the transient, persistent and detached state in Hibernate?

Answer -

  • Transient state: New objects are created in the Java program but are not associated with any Hibernate Session.
  • Persistent state: An object which is associated with a Hibernate session is called Persistent object. While an object which was earlier associated with Hibernate session but currently it’s not associate is known as a detached object. You can call save() or persist() method to store those object into the database and bring them into the Persistent state.
  • Detached state: You can re-attach a detached object to Hibernate sessions by calling either update() or saveOrUpdate() method.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners