0 votes
in Hibernate by

Describe the differences between Hibernate’s transient, persistent, and detached states.

1 Answer

0 votes
by

Here is how the states differ:

Transient. This state describes new objects that are created in Java but not associated with a Hibernate session.

Persistent. This state describes objects associated with a Hibernate session.

Detached. This state describes an object that was formerly Persistent and associated with a Hibernate session. Developers can reattach the object to a Hibernate session by using either update() or saveOrUpdate().

...