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. 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:
- JDO 2.0
Public Methods
FetchPlan addGroup(String fetchGroupName)
- Return:
- the FetchPlan
- Since:
- JDO 2.0
FetchPlan clearGroups()
- Return:
- the FetchPlan
- Since:
- JDO 2.0
int getDetachmentOptions()
- Since:
- JDO 2.0
Class[] getDetachmentRootClasses()
- Return:
- The detachment root classes
- Since:
- JDO 2.0
Collection getDetachmentRoots()
- Return:
- Collection of detachment roots.
- Since:
- JDO 2.0
int getFetchSize()
- Return:
- the fetch size
- Since:
- JDO 2.0
Set getGroups()
The Set is a copy of the currently active groups and will not change based on subsequent changes to the groups.
- Return:
- an immutable Set containing the names of all currently active fetch groups
- Since:
- JDO 2.0
int getMaxFetchDepth()
- Return:
- the maximum fetch depth
- Since:
- JDO 2.0
FetchPlan removeGroup(String fetchGroupName)
- Return:
- the FetchPlan
- Since:
- JDO 2.0
FetchPlan setDetachmentOptions(int options)
FetchPlan setDetachmentRootClasses(Class... rootClasses)
- Parameters:
rootClasses
- The root classes.
- Since:
- JDO 2.0
FetchPlan setDetachmentRoots(Collection roots)
- Parameters:
roots
- Collection of the detachment roots.
- Since:
- JDO 2.0
FetchPlan setFetchSize(int fetchSize)
Use FETCH_SIZE_OPTIMAL to unset, and FETCH_SIZE_GREEDY to force loading of everything.
- Parameters:
fetchSize
- the fetch size
- Return:
- the FetchPlan
- Since:
- JDO 2.0
FetchPlan setGroup(String fetchGroupName)
- Parameters:
fetchGroupName
- the single fetch group
- Return:
- the FetchPlan
- Since:
- JDO 2.0
FetchPlan setGroups(Collection fetchGroupNames)
- Parameters:
fetchGroupNames
- a collection of names of fetch groups
- Return:
- the FetchPlan
- Since:
- JDO 2.0
FetchPlan setGroups(String... fetchGroupNames)
- Parameters:
fetchGroupNames
- a String array of names of fetch groups
- Return:
- the FetchPlan
- Since:
- JDO 2.0
FetchPlan setMaxFetchDepth(int fetchDepth)
A value of 0 has no meaning and will throw a JDOUserException. A value of -1 means that no limit is placed on fetching. A positive integer will result in that number of references from the initial object to be fetched.
- Parameters:
fetchDepth
- the depth
- Return:
- the FetchPlan
- Since:
- JDO 2.0
Public Static Fields
Value:
all
. - Since:
- JDO 2.0
Value:
default
. - Since:
- JDO 2.0
Specifies that fields that are not loaded but are in the current fetch plan should be loaded prior to detachment.
- Since:
- JDO 2.0
Specifies that fields that are loaded but not in the current fetch plan should be unloaded prior to detachment.
- Since:
- JDO 2.0
Value: -1.
- Since:
- JDO 2.0
Value: 0.
- Since:
- JDO 2.0