EclipseLink 2.1.2, build 'v20101206-r8635' API Reference

org.eclipse.persistence.annotations
Enum BatchFetchType

java.lang.Object
  extended by java.lang.Enum<BatchFetchType>
      extended by org.eclipse.persistence.annotations.BatchFetchType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<BatchFetchType>

public enum BatchFetchType
extends java.lang.Enum<BatchFetchType>

Enum used with the BatchFetch annotation, or "eclipselink.batch.type" query hint. This can be specified on a mapping or query to configure the type of batch reading to be used.

See Also:
BatchFetch, ForeignReferenceMapping#setBatchFetch(BatchFetchType)
Author:
James Sutherland
Since:
EclipseLink 2.1

Enum Constant Summary
EXISTS
          This uses an SQL EXISTS and a sub-select in the batch query instead of a join.
IN
          This uses an SQL IN clause in the batch query passing in the source object Ids.
JOIN
          This is the default form of batch reading.
 
Method Summary
static BatchFetchType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static BatchFetchType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

JOIN

public static final BatchFetchType JOIN
This is the default form of batch reading. The original query's selection criteria is joined with the batch query.


EXISTS

public static final BatchFetchType EXISTS
This uses an SQL EXISTS and a sub-select in the batch query instead of a join. This has the advantage of not requiring an SQL DISTINCT which can have issues with LOBs, or may be more efficient for some types of queries or on some databases.


IN

public static final BatchFetchType IN
This uses an SQL IN clause in the batch query passing in the source object Ids. This has the advantage of only selecting the objects not already contained in the cache, and can work better with cursors, or if joins cannot be used. This may only work for singleton Ids on some databases.

Method Detail

values

public static BatchFetchType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (BatchFetchType c : BatchFetchType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static BatchFetchType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

EclipseLink 2.1.2, build 'v20101206-r8635' API Reference