|
44 | 44 | * {@code Session}. |
45 | 45 | * </ul> |
46 | 46 | * <p> |
47 | | - * At any given time, an instance may be associated with at most one open session. |
| 47 | + * Each persistent instance has a <em>persistent identity</em> determined by its type |
| 48 | + * and identifier value. There may be at most one persistent instance with a given |
| 49 | + * persistent identity associated with a given session. Normally, a persistent identity |
| 50 | + * is assigned when an {@linkplain #persist(Object) instance is made persistent}, but |
| 51 | + * when the entity identifier is {@linkplain org.hibernate.generator.OnExecutionGenerator |
| 52 | + * generated by the database}, assignment of the persistent identity is delayed until |
| 53 | + * the state of the entity is actually inserted in the database. |
| 54 | + * <p> |
| 55 | + * An instance of an entity class may be associated with at most one open session. |
| 56 | + * Distinct sessions represent state with the same persistent identity using distinct |
| 57 | + * persistent instances of the mapped entity class. |
48 | 58 | * <p> |
49 | 59 | * Any instance returned by {@link #get(Class, Object)}, {@link #find(Class, Object)}, |
50 | 60 | * or by a query is persistent. A persistent instance might hold references to other |
|
59 | 69 | * <p> |
60 | 70 | * A transient instance may be made persistent by calling {@link #persist(Object)}. |
61 | 71 | * A persistent instance may be made detached by calling {@link #detach(Object)}. |
62 | | - * A persistent instance may be marked for removal, and eventually made transient, by |
63 | | - * calling {@link #remove(Object)}. |
| 72 | + * A persistent instance may be marked for removal, and eventually made transient, |
| 73 | + * by calling {@link #remove(Object)}. |
64 | 74 | * <p> |
65 | 75 | * Persistent instances are held in a managed state by the persistence context. Any |
66 | 76 | * change to the state of a persistent instance is automatically detected and eventually |
|
0 commit comments