0 votes
in JAVA by
What are the Different States in Hibernate?

1 Answer

0 votes
by

transient - New objects created in the Java program but not associated with any hibernate Session are said to be in the transient state.

persistent - An object which is associated with a Hibernate session is called a Persistent object. While an object which was earlier associated with Hibernate session but currently it's not associated is known as a detached object. You can call the save() or persist() method to store those objects into the database and bring them into the Persistent state.

detached - You can re-attach a detached object to hibernate sessions by calling either update() or saveOrUpdate() method.

Related questions

0 votes
asked Apr 14, 2023 in JAVA by SakshiSharma
0 votes
asked Apr 14, 2023 in JAVA by SakshiSharma
...