diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/LazyGroup.java b/hibernate-core/src/main/java/org/hibernate/annotations/LazyGroup.java index cc683c0a6d..4424f594d6 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/LazyGroup.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/LazyGroup.java @@ -11,12 +11,34 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** - * For use with bytecode-enhanced lazy-loading support. - *
- * Identifies grouping for performing lazy attribute loading. By default all - * non-collection attributes are loaded in one group named {@code "DEFAULT"}. - * This annotation allows defining different groups of attributes to be - * initialized together when access one attribute in the group. + * Specifies the fetch group for a persistent attribute of an entity + * class. This annotation has no effect unless bytecode enhancement is used, + * and field-level lazy fetching is enabled. + *+ * For example, a field annotated {@code @Basic(fetch=LAZY) @LazyGroup("extra")} + * belongs to the fetch group named {@code "extra"}, and is loaded whenever an + * attribute belonging to the {@code "extra"} fetch group is accessed. + *
+ * Note that field-level lazy fetching is usually of dubious value, and most + * projects using Hibernate don't even bother enabling the bytecode enhancer. * * @author Steve Ebersole */