Class FetchGroupManager
java.lang.Object
org.datanucleus.FetchGroupManager
Manager for dynamic fetch groups.
Manages a set of fetch groups with each FetchGroup for a particular class with a name.
This class is thread safe.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<String, Set<FetchGroup>> Map of dynamic fetch groups, keyed by the group name.private NucleusContextContext that we are operating in. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for a FetchGroupManager for a particular Context. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFetchGroup(FetchGroup grp) Method to add a dynamic fetch group.voidClear out all fetch groups from use by this manager.<T> FetchGroup<T> createFetchGroup(Class<T> cls, String name) Method to create a new FetchGroup for the class and name.<T> FetchGroup<T> getFetchGroup(Class<T> cls, String name, boolean createIfNotPresent) Accessor for a fetch group for the specified class.getFetchGroupsWithName(String name) Accessor for the fetch groups for the specified name.voidMethod to remove a dynamic FetchGroup from use.
-
Field Details
-
fetchGroupByName
Map of dynamic fetch groups, keyed by the group name. -
nucleusCtx
Context that we are operating in.
-
-
Constructor Details
-
FetchGroupManager
Constructor for a FetchGroupManager for a particular Context.- Parameters:
ctx- The Context
-
-
Method Details
-
addFetchGroup
Method to add a dynamic fetch group.- Parameters:
grp- The fetch group
-
removeFetchGroup
Method to remove a dynamic FetchGroup from use.- Parameters:
grp- The group
-
getFetchGroup
Accessor for a fetch group for the specified class. If the fetch group of this name for this class doesn't exist then will create one if the flag is set.- Type Parameters:
T- Type that the FetchGroup is for- Parameters:
cls- The classname- Name of the groupcreateIfNotPresent- Whether this method should create+add a FetchGroup if on with this name isn't found.- Returns:
- The FetchGroup
-
createFetchGroup
Method to create a new FetchGroup for the class and name. Doesn't add it to the internally managed groups.- Type Parameters:
T- Type that the FetchGroup is for- Parameters:
cls- The classname- Name of the group- Returns:
- The FetchGroup
-
getFetchGroupsWithName
Accessor for the fetch groups for the specified name. Used by FetchPlan to find FetchGroups for a specific name.- Parameters:
name- Name of the group- Returns:
- The FetchGroup
-
clearFetchGroups
public void clearFetchGroups()Clear out all fetch groups from use by this manager.
-