Skip to content

Commit b73d381

Browse files
committed
improve javadoc of TransientObjectException
1 parent f9e1cfc commit b73d381

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

hibernate-core/src/main/java/org/hibernate/TransientObjectException.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,20 @@
55
package org.hibernate;
66

77
/**
8-
* Thrown when the user passes a transient instance to a {@link Session}
9-
* method that expects a persistent instance.
8+
* Thrown if a transient instance of an entity class is passed to
9+
* a {@link Session} method that expects a persistent instance,
10+
* or if the state of an entity instance cannot be made persistent
11+
* because the instance holds a reference to a transient entity.
12+
* <p>
13+
* An entity is considered <em>transient</em> if it is:
14+
* <ul>
15+
* <li>a newly-instantiated instance of an entity class which has
16+
* never been {@linkplain Session#persist made persistent} in
17+
* the database, or
18+
* <li>an entity instance previously associated with a persistence
19+
* context which has been {@linkplain Session#remove removed}
20+
* from the database.
21+
* </ul>
1022
*
1123
* @author Gavin King
1224
*/

hibernate-core/src/main/java/org/hibernate/TransientPropertyValueException.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,18 @@
77
import static org.hibernate.internal.util.StringHelper.qualify;
88

99
/**
10-
* Thrown when a property cannot be persisted because it is an association
11-
* with a transient unsaved entity instance.
10+
* Thrown when the state of an entity cannot be made persistent
11+
* because the entity holds a reference to a transient entity.
12+
* <p>
13+
* An entity is considered <em>transient</em> if it is:
14+
* <ul>
15+
* <li>a newly-instantiated instance of an entity class which has
16+
* never been {@linkplain Session#persist made persistent} in
17+
* the database, or
18+
* <li>an entity instance previously associated with a persistence
19+
* context which has been {@linkplain Session#remove removed}
20+
* from the database.
21+
* </ul>
1222
*
1323
* @author Gail Badner
1424
*/

0 commit comments

Comments
 (0)