public interface FetchPlan
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
.Modifier and Type | Field | Description |
---|---|---|
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 |
DETACH_LOAD_FIELDS |
For use with
PersistenceManager.detachCopy(T) and
setDetachmentOptions(int) . |
static int |
DETACH_UNLOAD_FIELDS |
For use with
PersistenceManager.detachCopy(T) and
setDetachmentOptions(int) . |
static int |
FETCH_SIZE_GREEDY |
For use with
setFetchSize(int) . |
static int |
FETCH_SIZE_OPTIMAL |
For use with
setFetchSize(int) . |
Modifier and Type | Method | Description |
---|---|---|
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 |
getDetachmentOptions() |
Get options used during detachment.
|
java.lang.Class[] |
getDetachmentRootClasses() |
Get the root classes for DetachAllOnCommit.
|
java.util.Collection |
getDetachmentRoots() |
Get the roots for DetachAllOnCommit.
|
int |
getFetchSize() |
Return the fetch size, or
FETCH_SIZE_OPTIMAL if not set,
or FETCH_SIZE_GREEDY to fetch all. |
java.util.Set |
getGroups() |
Return an immutable Set containing the names
of all active fetch groups.
|
int |
getMaxFetchDepth() |
Return the maximum fetch depth used when fetching instances.
|
FetchPlan |
removeGroup(java.lang.String fetchGroupName) |
Remove the fetch group from the set active fetch groups.
|
FetchPlan |
setDetachmentOptions(int options) |
Set options to be used during detachment.
|
FetchPlan |
setDetachmentRootClasses(java.lang.Class... rootClasses) |
Set the root classes for DetachAllOnCommit.
|
FetchPlan |
setDetachmentRoots(java.util.Collection roots) |
Set the roots for DetachAllOnCommit.
|
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.lang.String... fetchGroupNames) |
Set a collection of groups.
|
FetchPlan |
setGroups(java.util.Collection fetchGroupNames) |
Set a collection of groups.
|
FetchPlan |
setMaxFetchDepth(int fetchDepth) |
Set the maximum fetch depth when fetching.
|
static final java.lang.String DEFAULT
addGroup(java.lang.String)
, removeGroup(java.lang.String)
, and the
various setGroups(java.util.Collection)
calls. Value: default
.static final java.lang.String ALL
addGroup(java.lang.String)
, removeGroup(java.lang.String)
, and the
various setGroups(java.util.Collection)
calls. Value: all
.static final int DETACH_UNLOAD_FIELDS
PersistenceManager.detachCopy(T)
and
setDetachmentOptions(int)
. Specifies that
fields that are loaded but not in the current fetch plan should
be unloaded prior to detachment.static final int DETACH_LOAD_FIELDS
PersistenceManager.detachCopy(T)
and
setDetachmentOptions(int)
. Specifies that
fields that are not loaded but are in the current fetch plan should
be loaded prior to detachment.static final int FETCH_SIZE_GREEDY
setFetchSize(int)
. Value: -1.static final int FETCH_SIZE_OPTIMAL
setFetchSize(int)
. Value: 0.FetchPlan addGroup(java.lang.String fetchGroupName)
FetchPlan removeGroup(java.lang.String fetchGroupName)
FetchPlan clearGroups()
java.util.Set getGroups()
FetchPlan setGroups(java.util.Collection fetchGroupNames)
fetchGroupNames
- a collection of names of fetch groupsFetchPlan setGroups(java.lang.String... fetchGroupNames)
fetchGroupNames
- a String array of names of fetch groupsFetchPlan setGroup(java.lang.String fetchGroupName)
fetchGroupName
- the single fetch groupFetchPlan setMaxFetchDepth(int fetchDepth)
fetchDepth
- the depthint getMaxFetchDepth()
FetchPlan setDetachmentRoots(java.util.Collection roots)
roots
- Collection of the detachment roots.java.util.Collection getDetachmentRoots()
FetchPlan setDetachmentRootClasses(java.lang.Class... rootClasses)
rootClasses
- The root classes.java.lang.Class[] getDetachmentRootClasses()
FetchPlan setFetchSize(int fetchSize)
FETCH_SIZE_OPTIMAL
to unset, and FETCH_SIZE_GREEDY
to force loading of everything.fetchSize
- the fetch sizeint getFetchSize()
FETCH_SIZE_OPTIMAL
if not set,
or FETCH_SIZE_GREEDY
to fetch all.FetchPlan setDetachmentOptions(int options)
DETACH_LOAD_FIELDS
and DETACH_UNLOAD_FIELDS
.int getDetachmentOptions()