Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "EclipseLink/UserGuide/JPA/2.4/a batchfetch"

m (New page: {{EclipseLink_TLJPA |info=n |toc=n |category=JPA |release=2.4.x}} <span class="metaname"> </span> {| class="simple oac_no_warn" width="100%" | align="left" valign="top" | '''Java Pers...)
 
m
Line 3: Line 3:
 
|toc=n
 
|toc=n
 
|category=JPA
 
|category=JPA
|release=2.4.x}}
+
|release=2.4.x
 +
|title= }}
 
<span class="metaname">    </span>
 
<span class="metaname">    </span>
  
 
{| class="simple oac_no_warn" width="100%"
 
{| class="simple oac_no_warn" width="100%"
| align="left" valign="top" | '''Java Persistence API (JPA) Extensions Reference for EclipseLink'''<br />'''Version 2.4.x'''<br />
+
| align="left" valign="top" |
 
| width="144" align="right" valign="bottom" |
 
| width="144" align="right" valign="bottom" |
 
{| class="simple oac_no_warn" width="100%"
 
{| class="simple oac_no_warn" width="100%"

Revision as of 07:22, 8 June 2012


EclipseLink, 2.4.x

Search

Contents


<- Previous

Next ->


@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=IN to definite number of keys in each IN clause

256 or the query's pageSize (for cursor queries)

BatchFetchType

(optional) The type of batch fetch to use:

  • JOIN
  • EXISTS
  • IN

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:


<- Previous

Next ->

EclispeLink
EclipseLink Home

Search

Contents

Back to the top