|
7 | 7 | package org.hibernate.annotations;
|
8 | 8 |
|
9 | 9 | /**
|
10 |
| - * Lazy options available for a collection. |
| 10 | + * Enumerates the options for lazy loading of a |
| 11 | + * {@linkplain jakarta.persistence.ElementCollection collection}, |
| 12 | + * {@linkplain jakarta.persistence.ManyToOne many to one association}, |
| 13 | + * or {@linkplain jakarta.persistence.ManyToMany many to many association}. |
11 | 14 | *
|
12 | 15 | * @author Emmanuel Bernard
|
| 16 | + * |
| 17 | + * @see LazyCollection |
13 | 18 | */
|
14 | 19 | public enum LazyCollectionOption {
|
15 | 20 | /**
|
16 |
| - * Eagerly load it. |
| 21 | + * The collection is always loaded eagerly, and all its |
| 22 | + * elements are available immediately. However, access to |
| 23 | + * the collection is still mediated by an instance of |
| 24 | + * {@link org.hibernate.collection.spi.PersistentCollection}, |
| 25 | + * which tracks modifications to the collection. |
17 | 26 | */
|
18 | 27 | FALSE,
|
19 | 28 | /**
|
20 |
| - * Load it when the state is requested. |
| 29 | + * The underlying Java collection is proxied by an instance of |
| 30 | + * {@link org.hibernate.collection.spi.PersistentCollection} |
| 31 | + * and lazily fetched when a method of the proxy is called. |
| 32 | + * All elements of the collection are retrieved at once. |
21 | 33 | */
|
22 | 34 | TRUE,
|
23 | 35 | /**
|
24 |
| - * Prefer extra queries over full collection loading. |
| 36 | + * The underlying Java collection is proxied by an instance of |
| 37 | + * {@link org.hibernate.collection.spi.PersistentCollection} |
| 38 | + * and its state is fetched lazily from the database as needed, |
| 39 | + * when methods of the proxy are called. When reasonable, the |
| 40 | + * proxy will avoid fetching all elements of the collection |
| 41 | + * at once. |
25 | 42 | */
|
26 | 43 | EXTRA
|
27 | 44 | }
|
0 commit comments