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
.
ALL
public static final String ALL
DEFAULT
public static final String DEFAULT
DETACH_LOAD_FIELDS
public static final int DETACH_LOAD_FIELDS
DETACH_UNLOAD_FIELDS
public static final int DETACH_UNLOAD_FIELDS
FETCH_SIZE_GREEDY
public static final int FETCH_SIZE_GREEDY
FETCH_SIZE_OPTIMAL
public static final int FETCH_SIZE_OPTIMAL
addGroup
public FetchPlan addGroup(String fetchGroupName)
Add the fetch group to the set of active fetch groups.
clearGroups
public FetchPlan clearGroups()
Remove all active groups leaving no active fetch group.
getDetachmentOptions
public int getDetachmentOptions()
Get options used during detachment.
getDetachmentRootClasses
public Class[] getDetachmentRootClasses()
Get the root classes for DetachAllOnCommit.
- The detachment root classes
getDetachmentRoots
public Collection getDetachmentRoots()
Get the roots for DetachAllOnCommit.
- Collection of detachment roots.
getFetchSize
public int getFetchSize()
getGroups
public Set getGroups()
Return an immutable collection containing the names
of all active fetch groups.
- an immutable collection containing the names
of all active fetch groups
getMaxFetchDepth
public int getMaxFetchDepth()
Return the maximum fetch depth used when fetching instances.
removeGroup
public FetchPlan removeGroup(String fetchGroupName)
Remove the fetch group from the set active fetch groups.
setDetachmentOptions
public FetchPlan setDetachmentOptions(int options)
setDetachmentRootClasses
public FetchPlan setDetachmentRootClasses(Class[] rootClasses)
Set the root classes for DetachAllOnCommit.
rootClasses
- The root classes.
setDetachmentRoots
public FetchPlan setDetachmentRoots(Collection roots)
Set the roots for DetachAllOnCommit.
roots
- Collection of the detachment roots.
setFetchSize
public FetchPlan setFetchSize(int fetchSize)
fetchSize
- the fetch size
setGroup
public FetchPlan setGroup(String fetchGroupName)
Set the active fetch groups to the single named fetch group.
fetchGroupName
- the single fetch group
setGroups
public FetchPlan setGroups(Collection fetchGroupNames)
Set a collection of groups.
fetchGroupNames
- a collection of names of fetch groups
setGroups
public FetchPlan setGroups(String[] fetchGroupNames)
Set a collection of groups.
fetchGroupNames
- a String array of names of fetch groups
setMaxFetchDepth
public FetchPlan setMaxFetchDepth(int fetchDepth)
Set the maximum fetch depth when fetching.
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.