|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.FetchPlan
public class FetchPlan
FetchPlan for fields for use internally. A FetchPlan has a series of FetchPlanForClass objects being the fetch plan for particular classes. Each FetchPlanForClass defines a series of fields of that class that are part of the fetch plan. There are two types of fetch groups under consideration here.
| Field Summary | |
|---|---|
static java.lang.String |
ALL
Constant defining all fields |
static java.lang.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. |
protected static Localiser |
LOCALISER
Localisation utility for output messages |
static java.lang.String |
NONE
Constant defing no fields. |
| Constructor Summary | |
|---|---|
FetchPlan(ExecutionContext ec,
ClassLoaderResolver clr)
Constructor. |
|
| Method Summary | |
|---|---|
FetchPlan |
addGroup(java.lang.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. |
java.lang.Class[] |
getDetachmentRootClasses()
Accessor for the root classes of the detachment graph for DetachAllOnCommit. |
java.util.Collection |
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. |
java.util.Set<java.lang.String> |
getGroups()
Accessor for the static groups for this FetchPlan. |
int |
getMaxFetchDepth()
Accessor for the maximum fetch depth. |
FetchPlanForClass |
manageFetchPlanForClass(AbstractClassMetaData cmd)
Manage the fetch plan for the class |
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(java.lang.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(java.lang.Class[] rootClasses)
Set the classes used for roots of the detachment graph for DetachAllOnCommit. |
FetchPlan |
setDetachmentRoots(java.util.Collection roots)
Set the roots for DetachAllOnCommit |
FetchPlan |
setFetchSize(int fetchSize)
Method to set the fetch size when using large result sets. |
FetchPlan |
setGroup(java.lang.String grpName)
Method to set the fetch group. |
FetchPlan |
setGroups(java.util.Collection<java.lang.String> grpNames)
Method to set the groups of the fetch plan. |
FetchPlan |
setGroups(java.lang.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. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final Localiser LOCALISER
public static final java.lang.String DEFAULT
public static final java.lang.String ALL
public static final java.lang.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
| Constructor Detail |
|---|
public FetchPlan(ExecutionContext ec,
ClassLoaderResolver clr)
ec - execution contextclr - ClassLoader Resolver| Method Detail |
|---|
public FetchPlanForClass manageFetchPlanForClass(AbstractClassMetaData cmd)
cmd - MetaData for the class to manage
public FetchPlanForClass getFetchPlanForClass(AbstractClassMetaData cmd)
cmd - metadata for the class
public FetchPlan addGroup(java.lang.String grpName)
grpName - The fetch group to add
public FetchPlan removeGroup(java.lang.String grpName)
grpName - The fetch group to remove
public FetchPlan clearGroups()
public java.util.Set<java.lang.String> getGroups()
public FetchPlan setGroups(java.util.Collection<java.lang.String> grpNames)
grpNames - Names of the groups
public FetchPlan setGroups(java.lang.String[] grpNames)
grpNames - Names of the groups
public FetchPlan setGroup(java.lang.String grpName)
grpName - Name of the group
public void notifyFetchGroupChange(FetchGroup group)
group - The dynamic FetchGrouppublic void notifyFetchGroupRemove(FetchGroup group)
group - The dynamic FetchGrouppublic FetchPlan setDetachmentRoots(java.util.Collection roots)
roots - The roots of the detachment graph.
public java.util.Collection getDetachmentRoots()
public FetchPlan setDetachmentRootClasses(java.lang.Class[] rootClasses)
rootClasses - Classes to be used as roots of the detachment graph
public java.lang.Class[] getDetachmentRootClasses()
public FetchPlan setMaxFetchDepth(int max)
max - The maximum fetch depth to fetch topublic int getMaxFetchDepth()
public FetchPlan setFetchSize(int fetchSize)
fetchSize - the size
public int getFetchSize()
public int getDetachmentOptions()
public FetchPlan setDetachmentOptions(int options)
options - The options
public java.lang.String toString()
toString in class java.lang.Objectpublic FetchPlan getCopy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||