3.6.7. Fetch Groups
Fetch groups are sets of fields that load together. They can be used to pool together associated fields in order to provide performance improvements over standard data fetching. Specifying fetch groups allows for tuning of lazy loading and eager fetching behavior.
The JPA Overview’s Fetch Type describes how to use JPA metadata annotations to control whether a field is fetched eagerly or lazily. Fetch groups add a dynamic aspect to this standard ability. As you will see, OpenJPA’s JPA extensions allow you can add and remove fetch groups at runtime to vary the sets of fields that are eagerly loaded.