Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
EclipseLink/UserGuide/JPA/2.4/a batchfetch
|
@BatchFetch
Use @BatchFetch
to read objects related to a relationship mapping (such as one-to-one, one-to-many, many-to-one, many-to-many, and element collection) to be read in a single query.
Annotation Elements
Table 2-1 describes this annotation's elements.
Table 2-1 @BatchFetch Annotation Elements
Annotation Element | Description | Default |
---|---|---|
size |
Default size of the batch fetch, used only when |
|
BatchFetchType |
(optional) The type of batch fetch to use:
|
JOIN |
Usage
Batch fetching allows for the optimal loading of a tree. Setting the @BatchFetch
annotation on a child relationship of a tree structure causes EclipseLink to use a single SQL statement for each level.
Examples
Para.
Example 2-1 Using JOIN BatchFetch Type
Example 2-2 Using EXISTS BatchFetch Type
Example 2-3 Using IN BatchFetch Type
See Also
For more information, see:
|
|