Use eclipselink.load-group
to configures a query to use the load group object.
Values
Table 4-23 describes this persistence property's values.
Usage
With load groups, EclipseLink ensures that all relational attributes for a group are loaded. LoadGroups are only supported for queries returning objects (only a single alias can be the select clause).
Examples
Example 4-46 Using load-group in a JPA Query
import org.eclipse.persistence.config.HintValues; import org.eclipse.persistence.config.QueryHints; query.setHint("eclipselink.LOAD_GROUP", lg);
Example 4-47 Using load-group in a @QueryHint Annotation
import org.eclipse.persistence.config.HintValues; import org.eclipse.persistence.config.QueryHints; @QueryHint(name=QueryHints.LOAD_GROUP, value="lg");
See Also
For more information, see:
"AttributeGroup Types and Operations" in Understanding EclipseLink
EclipseLink Attribute Group example:
http://wiki.eclipse.org/EclipseLink/Examples/JPA/AttributeGroup