javax.jdo
Interface FetchPlan


public interface FetchPlan

Fetch groups are activated using methods on this interface. An instance of this interface can be obtained from PersistenceManager.getFetchPlan(), Extent.getFetchPlan(), and Query.getFetchPlan(). When a Query or Extent is retrieved from a PersistenceManager, its FetchPlan is initialized to the same settings as that of the PersistenceManager. Subsequent modifications of the Query or Extent's FetchPlan are not reflected in the FetchPlan of the PersistenceManager.

Since:
2.0
Version:
2.0

Field Summary
static java.lang.String ALL
          For use with addGroup(java.lang.String), removeGroup(java.lang.String), and the various setGroups(java.util.Collection) calls.
static java.lang.String DEFAULT
          For use with addGroup(java.lang.String), removeGroup(java.lang.String), and the various setGroups(java.util.Collection) calls.
static int FETCH_SIZE_GREEDY
          For use with setFetchSize(int).
static int FETCH_SIZE_OPTIMAL
          For use with setFetchSize(int).
static java.lang.String NONE
          For use with addGroup(java.lang.String), removeGroup(java.lang.String), and the various setGroups(java.util.Collection) calls.
static java.lang.String VALUES
          For use with addGroup(java.lang.String), removeGroup(java.lang.String), and the various setGroups(java.util.Collection) calls.
 
Method Summary
 FetchPlan addGroup(java.lang.String fetchGroupName)
          Add the fetch group to the set of active fetch groups.
 FetchPlan clearGroups()
          Remove all active groups leaving no active fetch group.
 int getFetchSize()
          Return the fetch size, or FETCH_SIZE_OPTIMAL if not set, or FETCH_SIZE_GREEDY to fetch all.
 java.util.Collection getGroups()
          Return the names of all active fetch groups.
 FetchPlan removeGroup(java.lang.String fetchGroupName)
          Remove the fetch group from the set active fetch groups.
 FetchPlan setFetchSize(int fetchSize)
          Set the fetch size for large result set support.
 FetchPlan setGroup(java.lang.String fetchGroupName)
          Set the active fetch groups to the single named fetch group.
 FetchPlan setGroups(java.util.Collection fetchGroupNames)
          Set a collection of groups.
 FetchPlan setGroups(java.lang.String[] fetchGroupNames)
          Set a collection of groups.
 

Field Detail

DEFAULT

public static final java.lang.String DEFAULT
For use with addGroup(java.lang.String), removeGroup(java.lang.String), and the various setGroups(java.util.Collection) calls. Value: default.

Since:
2.0
See Also:
Constant Field Values

ALL

public static final java.lang.String ALL
For use with addGroup(java.lang.String), removeGroup(java.lang.String), and the various setGroups(java.util.Collection) calls. Value: all.

Since:
2.0
See Also:
Constant Field Values

VALUES

public static final java.lang.String VALUES
For use with addGroup(java.lang.String), removeGroup(java.lang.String), and the various setGroups(java.util.Collection) calls. Value: values.

Since:
2.0
See Also:
Constant Field Values

NONE

public static final java.lang.String NONE
For use with addGroup(java.lang.String), removeGroup(java.lang.String), and the various setGroups(java.util.Collection) calls. Value: none. ### this is not mentioned in 12.7.2. It is referred to in 12.7's text.

Since:
2.0
See Also:
Constant Field Values

FETCH_SIZE_GREEDY

public static final int FETCH_SIZE_GREEDY
For use with setFetchSize(int). Value: -1.

Since:
2.0
See Also:
Constant Field Values

FETCH_SIZE_OPTIMAL

public static final int FETCH_SIZE_OPTIMAL
For use with setFetchSize(int). Value: 0.

Since:
2.0
See Also:
Constant Field Values
Method Detail

addGroup

public FetchPlan addGroup(java.lang.String fetchGroupName)
Add the fetch group to the set of active fetch groups.

Returns:
the FetchPlan
Since:
2.0

removeGroup

public FetchPlan removeGroup(java.lang.String fetchGroupName)
Remove the fetch group from the set active fetch groups.

Returns:
the FetchPlan
Since:
2.0

clearGroups

public FetchPlan clearGroups()
Remove all active groups leaving no active fetch group.

Returns:
the FetchPlan
Since:
2.0

getGroups

public java.util.Collection getGroups()
Return the names of all active fetch groups.

Returns:
the names of active fetch groups
Since:
2.0

setGroups

public FetchPlan setGroups(java.util.Collection fetchGroupNames)
Set a collection of groups.

Parameters:
fetchGroupNames - a collection of names of fetch groups
Returns:
the FetchPlan
Since:
2.0

setGroups

public FetchPlan setGroups(java.lang.String[] fetchGroupNames)
Set a collection of groups.

Parameters:
fetchGroupNames - a String array of names of fetch groups
Returns:
the FetchPlan
Since:
2.0

setGroup

public FetchPlan setGroup(java.lang.String fetchGroupName)
Set the active fetch groups to the single named fetch group.

Parameters:
fetchGroupName - the single fetch group
Returns:
the FetchPlan
Since:
2.0

setFetchSize

public FetchPlan setFetchSize(int fetchSize)
Set the fetch size for large result set support. Use FETCH_SIZE_OPTIMAL to unset, and FETCH_SIZE_GREEDY to force loading of everything.

Parameters:
fetchSize - the fetch size
Returns:
the FetchPlan
Since:
2.0

getFetchSize

public int getFetchSize()
Return the fetch size, or FETCH_SIZE_OPTIMAL if not set, or FETCH_SIZE_GREEDY to fetch all.

Returns:
the fetch size
Since:
2.0