EclipseLink 2.3.2, build 'v20111125-r10461' API Reference

org.eclipse.persistence.annotations
Annotation Type BatchFetch


@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface BatchFetch

A BatchFetch annotation can be used on any relationship mapping, (OneToOne, ManyToOne, OneToMany, ManyToMany, ElementCollection, BasicCollection, BasicMap). It allows the related objects to be batch read in a single query. Batch fetching can also be set at the query level, and it is normally recommended to do so as all queries may not require batching.

Author:
James Sutherland
Since:
EclipseLink 2.1

Optional Element Summary
 int size
          Define the default batch fetch size.
 BatchFetchType value
          (Optional) The type of batch-fetch to use.
 

value

public abstract BatchFetchType value
(Optional) The type of batch-fetch to use. Either JOIN, EXISTS or IN. JOIN is the default.

Default:
org.eclipse.persistence.annotations.BatchFetchType.JOIN

size

public abstract int size
Define the default batch fetch size. This is only used for IN type batch reading and defines the number of keys used in each IN clause. The default size is 256, or the query's pageSize for cursor queries.

Default:
-1

EclipseLink 2.3.2, build 'v20111125-r10461' API Reference