public class FetchPlan extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
ALL
Constant defining all fields
|
static String |
DEFAULT
Constant defining the fields in the default fetch group.
|
static int |
DETACH_LOAD_FIELDS
Members that are not loaded but are in the current fetch plan should be loaded before detachment.
|
static int |
DETACH_UNLOAD_FIELDS
Members that are loaded but not in current fetch plan should be unloaded before detachment.
|
static int |
FETCH_SIZE_GREEDY
Fetch size to load all possible.
|
static int |
FETCH_SIZE_OPTIMAL
Fetch size for the implementation to decide how many to load.
|
static String |
NONE
Constant defing no fields.
|
Constructor and Description |
---|
FetchPlan(ExecutionContext ec,
ClassLoaderResolver clr)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
FetchPlan |
addGroup(String grpName)
Method to add a group to the fetch plan.
|
FetchPlan |
clearGroups()
Method to clear the current groups and activate the DFG.
|
FetchPlan |
getCopy()
Returns a copy of this FetchPlan with all settings initialized.
|
int |
getDetachmentOptions()
Return the options to be used at detachment.
|
Class[] |
getDetachmentRootClasses()
Accessor for the root classes of the detachment graph for DetachAllOnCommit.
|
Collection<Object> |
getDetachmentRoots()
Accessor for the roots of the detachment graph for DetachAllOnCommit.
|
FetchPlanForClass |
getFetchPlanForClass(AbstractClassMetaData cmd)
Access the fetch plan for the class.
|
int |
getFetchSize()
Accessor for the fetch size when using large result sets.
|
Set<String> |
getGroups()
Accessor for the static groups for this FetchPlan.
|
int |
getMaxFetchDepth()
Accessor for the maximum fetch depth.
|
void |
notifyFetchGroupChange(FetchGroup group)
Method to notify this FetchPlan that the specified FetchGroup has been updated.
|
void |
notifyFetchGroupRemove(FetchGroup group)
Method to notify this FetchPlan that the specified FetchGroup has been updated.
|
FetchPlan |
removeGroup(String grpName)
Method to remove a group from the fetch plan.
|
FetchPlan |
setDetachmentOptions(int options)
Set the options to be used at detachment.
|
FetchPlan |
setDetachmentRootClasses(Class[] rootClasses)
Set the classes used for roots of the detachment graph for DetachAllOnCommit.
|
FetchPlan |
setDetachmentRoots(Collection roots)
Set the roots for DetachAllOnCommit
|
FetchPlan |
setFetchSize(int fetchSize)
Method to set the fetch size when using large result sets.
|
FetchPlan |
setGroup(String grpName)
Method to set the fetch group.
|
FetchPlan |
setGroups(Collection<String> grpNames)
Method to set the groups of the fetch plan.
|
FetchPlan |
setGroups(String[] grpNames)
Method to set the groups using an array.
|
FetchPlan |
setMaxFetchDepth(int max)
Mutator for the maximum fetch depth where
-1 implies no restriction on the fetch depth and
0 is invalid and throws a JDOUserException.
|
String |
toString() |
String |
toStringWithClasses() |
public static final String DEFAULT
public static final String ALL
public static final String NONE
public static final int DETACH_UNLOAD_FIELDS
public static final int DETACH_LOAD_FIELDS
public static final int FETCH_SIZE_GREEDY
public static final int FETCH_SIZE_OPTIMAL
public FetchPlan(ExecutionContext ec, ClassLoaderResolver clr)
ec
- execution contextclr
- ClassLoader Resolverpublic FetchPlanForClass getFetchPlanForClass(AbstractClassMetaData cmd)
cmd
- metadata for the classpublic FetchPlan addGroup(String grpName)
grpName
- The fetch group to addpublic FetchPlan removeGroup(String grpName)
grpName
- The fetch group to removepublic FetchPlan clearGroups()
public Set<String> getGroups()
public FetchPlan setGroups(Collection<String> grpNames)
grpNames
- Names of the groupspublic FetchPlan setGroups(String[] grpNames)
grpNames
- Names of the groupspublic FetchPlan setGroup(String grpName)
grpName
- Name of the grouppublic void notifyFetchGroupChange(FetchGroup group)
group
- The dynamic FetchGrouppublic void notifyFetchGroupRemove(FetchGroup group)
group
- The dynamic FetchGrouppublic FetchPlan setDetachmentRoots(Collection roots)
roots
- The roots of the detachment graph.public Collection<Object> getDetachmentRoots()
public FetchPlan setDetachmentRootClasses(Class[] rootClasses)
rootClasses
- Classes to be used as roots of the detachment graphpublic Class[] getDetachmentRootClasses()
public FetchPlan setMaxFetchDepth(int max)
max
- The maximum fetch depth to fetch topublic int getMaxFetchDepth()
public FetchPlan setFetchSize(int fetchSize)
fetchSize
- the sizepublic int getFetchSize()
public int getDetachmentOptions()
public FetchPlan setDetachmentOptions(int options)
options
- The optionspublic FetchPlan getCopy()
public String toStringWithClasses()
Copyright © 2019. All rights reserved.