public class FetchGroupManager extends Object
Purpose: The fetch group manager controls the named fetch groups defined at the descriptor level. TopLink supports multiple, overlapped fetch groups, optionally with one of them as the default fetch group. The domain object must implement oracle.toplink.essentials.queryframework.FetchGroupTracker interface, in order to make use of the fetch group performance enhancement feature. Please refer to FetchGroup class for the prons and cons of fetch group usage.
FetchGroup
,
FetchGroupTracker
Constructor and Description |
---|
FetchGroupManager()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addFetchGroup(FetchGroup group)
Add a named fetch group to the descriptor
|
Object |
clone()
INTERNAL:
Clone the fetch group manager
|
void |
copyFetchGroupInto(Object source,
Object target)
INTERNAL:
Copy fetch group refrerence from the source object to the target
|
ClassDescriptor |
getClassDescriptor()
INTERNAL:
Return the referenced descriptor.
|
FetchGroup |
getDefaultFetchGroup()
Return the descriptor-level default fetch group.
|
ClassDescriptor |
getDescriptor()
INTERNAL:
Return the referenced descriptor.
|
FetchGroup |
getFetchGroup(String groupName)
Return a pre-defined named fetch group.
|
Map |
getFetchGroups()
Return the fetch group map: keyed by the group name, valued by the fetch group object.
|
boolean |
isAttributeFetched(Object object,
String attributeName)
Return true if the attribute of the object has already been fetched
|
boolean |
isObjectValidForFetchGroup(Object object,
FetchGroup fetchGroup)
INTERNAL:
Return if the cached object data is sufficiently valid against a fetch group
|
boolean |
isPartialObject(Object domainObject)
INTERNAL:
Return true if the object is partially fetched and cached.
|
void |
prepareQueryWithFetchGroup(ObjectLevelReadQuery query)
INTERNAL:
Prepare the query with the fetch group to add group attributes to the query
for partial reading.
|
void |
reset(Object source)
INTERNAL:
Reset object attributes to the default values.
|
void |
setDefaultFetchGroup(FetchGroup newDefaultFetchGroup)
Set the descriptor-level default fetch group.
|
void |
setDescriptor(ClassDescriptor descriptor)
Set the referenced descriptor.
|
void |
setObjectFetchGroup(Object source,
FetchGroup fetchGroup)
INTERNAL:
Reset object attributes to the default their values.
|
void |
setRefreshOnFetchGroupToObject(Object source,
boolean shouldRefreshOnFetchgroup)
INTERNAL:
Set if the tracked object is fetched from executing a query with or without refresh.
|
boolean |
shouldWriteInto(Object cachedObject,
Object clone)
INTERNAL:
Return true if the cached object data should be written in clone.
|
void |
unionFetchGroupIntoObject(Object source,
FetchGroup newFetchGroup)
INTERNAL:
Union the fetch group of the domain object with the new fetch group.
|
FetchGroup |
unionFetchGroups(FetchGroup first,
FetchGroup second)
INTERNAL:
Union two fetch groups.
|
void |
writePartialIntoClones(Object partialObject,
Object workingClone,
UnitOfWorkImpl uow)
INTERNAL:
Write data of the partially fetched object into the working and backup clones
|
public void addFetchGroup(FetchGroup group)
public Map getFetchGroups()
public FetchGroup getDefaultFetchGroup()
public FetchGroup getFetchGroup(String groupName)
public void setDefaultFetchGroup(FetchGroup newDefaultFetchGroup)
public boolean isPartialObject(Object domainObject)
public boolean isObjectValidForFetchGroup(Object object, FetchGroup fetchGroup)
public boolean shouldWriteInto(Object cachedObject, Object clone)
public void writePartialIntoClones(Object partialObject, Object workingClone, UnitOfWorkImpl uow)
public void copyFetchGroupInto(Object source, Object target)
public void unionFetchGroupIntoObject(Object source, FetchGroup newFetchGroup)
public FetchGroup unionFetchGroups(FetchGroup first, FetchGroup second)
public void reset(Object source)
public void setObjectFetchGroup(Object source, FetchGroup fetchGroup)
public void setRefreshOnFetchGroupToObject(Object source, boolean shouldRefreshOnFetchgroup)
public boolean isAttributeFetched(Object object, String attributeName)
public ClassDescriptor getDescriptor()
public ClassDescriptor getClassDescriptor()
public void setDescriptor(ClassDescriptor descriptor)
public void prepareQueryWithFetchGroup(ObjectLevelReadQuery query)
Copyright © 2021. All rights reserved.