Package org.apache.openjpa.persistence
Class FetchPlanImpl
- java.lang.Object
 - 
- org.apache.openjpa.persistence.FetchPlanImpl
 
 
- 
- All Implemented Interfaces:
 FetchPlan
- Direct Known Subclasses:
 JDBCFetchPlanImpl
public class FetchPlanImpl extends Object implements FetchPlan
Implements FetchPlan via delegation to FetchConfiguration.- Since:
 - 0.4.1
 - Author:
 - Abe White, Pinaki Poddar
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected static Map<String,HintValueConverter[]>_hintsStructure holds one or more converters for a user-specified hint value.protected static Map<String,List<String>>_precedenceStructure holds ranking of equivalent hint keys.- 
Fields inherited from interface org.apache.openjpa.persistence.FetchPlan
DEFAULT, DEPTH_INFINITE, GROUP_ALL, GROUP_DEFAULT 
 - 
 
- 
Constructor Summary
Constructors Constructor Description FetchPlanImpl(FetchConfiguration fetch)Constructor; supply delegate. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FetchPlanaddFetchGroup(String group)Addsgroupto the set of fetch group to use when loading objects.FetchPlanaddFetchGroups(String... groups)Addsgroupsto the set of fetch group names to use when loading objects.FetchPlanaddFetchGroups(Collection groups)Addsgroupsto the set of fetch group names to use when loading objects.FetchPlanaddField(Class cls, String field)Addsfieldto the set of field names to use when loading objects.FetchPlanaddField(String field)Addsfieldto the set of fully-qualified field names to use when loading objects.FetchPlanaddFields(Class cls, String... fields)Addsfieldsto the set of field names to use when loading objects.FetchPlanaddFields(Class cls, Collection fields)Addsfieldsto the set of field names to use when loading objects.FetchPlanaddFields(String... fields)Addsfieldsto the set of fully-qualified field names to use when loading objects.FetchPlanaddFields(Collection fields)Addsfieldsto the set of fully-qualified field names to use when loading objects.FetchPlanclearFetchGroups()Clears the set of fetch group names to use wen loading data.FetchPlanclearFields()Clears the set of field names to use wen loading data.booleanequals(Object other)DataCacheRetrieveModegetCacheRetrieveMode()Gets the current retrieve mode for data cache.DataCacheStoreModegetCacheStoreMode()Gets the current storage mode for data cache.FetchConfigurationgetDelegate()Delegate.booleangetExtendedPathLookup()Affirms if extended path lookup feature is active.intgetFetchBatchSize()Return the fetch batch size for large result set support.Collection<String>getFetchGroups()Returns the names of the fetch groups that this component will use when loading objects.Collection<String>getFields()Returns the fully qualified names of the fields that this component will use when loading objects.ObjectgetHint(String key)Get the hint value for the given key.Map<String,Object>getHints()Get the hints and their values currently set on this receiver.jakarta.persistence.PessimisticLockScopegetLockScope()The lock scope to use for locking loaded objects.intgetLockTimeout()The number of milliseconds to wait for an object lock, or -1 for no limit.intgetMaxFetchDepth()The maximum fetch depth when loading an object.booleangetQueryResultCache()booleangetQueryResultCacheEnabled()Return whether or not query caching is enabled.intgetQueryTimeout()The number of milliseconds to wait for a query, or -1 for no limit.jakarta.persistence.LockModeTypegetReadLockMode()The lock level to use for locking loaded objects.jakarta.persistence.LockModeTypegetWriteLockMode()The lock level to use for locking dirtied objects.booleanhasField(Class cls, String field)Return true if the given field has been added.booleanhasField(String field)Return true if the given field has been added.inthashCode()protected DelegatingFetchConfigurationnewDelegatingFetchConfiguration(FetchConfiguration fetch)Create a new exception-translating delegating fetch configuration.protected static voidregisterHint(String[] keys, HintValueConverter... converters)Registers a hint key with its value converters.FetchPlanremoveFetchGroup(String group)Remove the given fetch group.FetchPlanremoveFetchGroups(String... groups)Removesgroupsfrom the set of fetch group names to use when loading objects.FetchPlanremoveFetchGroups(Collection groups)Removesgroupsfrom the set of fetch group names to use when loading objects.FetchPlanremoveField(Class cls, String field)Remove the given field.FetchPlanremoveField(String field)Remove the given fully-qualified field.FetchPlanremoveFields(Class cls, String... fields)Removesfieldsfrom the set of field names to use when loading objects.FetchPlanremoveFields(Class cls, Collection fields)Removesfieldsfrom the set of field names to use when loading objects.FetchPlanremoveFields(String... fields)Removesfieldsfrom the set of fully-qualified field names to use when loading objects.FetchPlanremoveFields(Collection fields)Removesfieldsfrom the set of fully-qualified field names to use when loading objects.FetchPlanresetFetchGroups()Resets the set of fetch groups to the list in the global configuration.FetchPlansetCacheRetrieveMode(DataCacheRetrieveMode mode)Sets the current retrieve mode for data cache.FetchPlansetCacheStoreMode(DataCacheStoreMode mode)Sets the current storage mode for data cache.FetchPlansetExtendedPathLookup(boolean flag)Sets extended path lookup feature.FetchPlansetFetchBatchSize(int fetchBatchSize)Set the fetch batch size for large result set support.voidsetHint(String key, Object value)Sets the hint after converting the value appropriately.voidsetHints(Map<String,Object> hints)FetchPlansetLockScope(jakarta.persistence.PessimisticLockScope scope)The lock scope to use for locking loaded objects.FetchPlansetLockTimeout(int timeout)The number of milliseconds to wait for an object lock, or -1 for no limit.FetchPlansetMaxFetchDepth(int depth)The maximum fetch depth when loading an object.FetchPlansetQueryResultCache(boolean cache)FetchPlansetQueryResultCacheEnabled(boolean cache)Control whether or not query caching is enabled.FetchPlansetQueryTimeout(int timeout)The number of milliseconds to wait for a query, or -1 for no limit.FetchPlansetReadLockMode(jakarta.persistence.LockModeType mode)The lock level to use for locking loaded objects.FetchPlansetWriteLockMode(jakarta.persistence.LockModeType mode)The lock level to use for locking dirtied objects. 
 - 
 
- 
- 
Field Detail
- 
_precedence
protected static Map<String,List<String>> _precedence
Structure holds ranking of equivalent hint keys. Each entry value is a list of other keys that are higher rank than the entry key. 
- 
_hints
protected static Map<String,HintValueConverter[]> _hints
Structure holds one or more converters for a user-specified hint value. 
 - 
 
- 
Constructor Detail
- 
FetchPlanImpl
public FetchPlanImpl(FetchConfiguration fetch)
Constructor; supply delegate. 
 - 
 
- 
Method Detail
- 
registerHint
protected static void registerHint(String[] keys, HintValueConverter... converters)
Registers a hint key with its value converters.- Parameters:
 keys- a set of keys in increasing order of ranking. Can not be null or empty.converters- array of converters that are attempts in order to convert a user-specified hint value to a value that is consumable by the kernel.
 
- 
newDelegatingFetchConfiguration
protected DelegatingFetchConfiguration newDelegatingFetchConfiguration(FetchConfiguration fetch)
Create a new exception-translating delegating fetch configuration. 
- 
getDelegate
public FetchConfiguration getDelegate()
Delegate.- Specified by:
 getDelegatein interfaceFetchPlan
 
- 
getMaxFetchDepth
public int getMaxFetchDepth()
Description copied from interface:FetchPlanThe maximum fetch depth when loading an object.- Specified by:
 getMaxFetchDepthin interfaceFetchPlan
 
- 
setMaxFetchDepth
public FetchPlan setMaxFetchDepth(int depth)
Description copied from interface:FetchPlanThe maximum fetch depth when loading an object.- Specified by:
 setMaxFetchDepthin interfaceFetchPlan
 
- 
getFetchBatchSize
public int getFetchBatchSize()
Description copied from interface:FetchPlanReturn the fetch batch size for large result set support. Defaults to theopenjpa.FetchBatchSizesetting. Note that this property will be ignored under some data stores.- Specified by:
 getFetchBatchSizein interfaceFetchPlan
 
- 
setFetchBatchSize
public FetchPlan setFetchBatchSize(int fetchBatchSize)
Description copied from interface:FetchPlanSet the fetch batch size for large result set support. Defaults to theopenjpa.FetchBatchSizesetting. Note that this property will be ignored under some data stores.- Specified by:
 setFetchBatchSizein interfaceFetchPlan
 
- 
getQueryResultCacheEnabled
public boolean getQueryResultCacheEnabled()
Description copied from interface:FetchPlanReturn whether or not query caching is enabled. If this returnstruebut the datacache plugin is not installed, caching will not be enabled. If this returnsfalse, query caching will not be used even if the datacache plugin is installed.- Specified by:
 getQueryResultCacheEnabledin interfaceFetchPlan
 
- 
setQueryResultCacheEnabled
public FetchPlan setQueryResultCacheEnabled(boolean cache)
Description copied from interface:FetchPlanControl whether or not query caching is enabled. This has no effect if the datacache plugin is not installed, or if the query cache size is set to zero.- Specified by:
 setQueryResultCacheEnabledin interfaceFetchPlan
 
- 
getQueryResultCache
public boolean getQueryResultCache()
- Specified by:
 getQueryResultCachein interfaceFetchPlan
 
- 
setQueryResultCache
public FetchPlan setQueryResultCache(boolean cache)
- Specified by:
 setQueryResultCachein interfaceFetchPlan
 
- 
getFetchGroups
public Collection<String> getFetchGroups()
Description copied from interface:FetchPlanReturns the names of the fetch groups that this component will use when loading objects. Defaults to theopenjpa.FetchGroupssetting.- Specified by:
 getFetchGroupsin interfaceFetchPlan
 
- 
addFetchGroup
public FetchPlan addFetchGroup(String group)
Description copied from interface:FetchPlanAddsgroupto the set of fetch group to use when loading objects.- Specified by:
 addFetchGroupin interfaceFetchPlan
 
- 
addFetchGroups
public FetchPlan addFetchGroups(String... groups)
Description copied from interface:FetchPlanAddsgroupsto the set of fetch group names to use when loading objects.- Specified by:
 addFetchGroupsin interfaceFetchPlan
 
- 
addFetchGroups
public FetchPlan addFetchGroups(Collection groups)
Description copied from interface:FetchPlanAddsgroupsto the set of fetch group names to use when loading objects.- Specified by:
 addFetchGroupsin interfaceFetchPlan
 
- 
removeFetchGroup
public FetchPlan removeFetchGroup(String group)
Description copied from interface:FetchPlanRemove the given fetch group.- Specified by:
 removeFetchGroupin interfaceFetchPlan
 
- 
removeFetchGroups
public FetchPlan removeFetchGroups(String... groups)
Description copied from interface:FetchPlanRemovesgroupsfrom the set of fetch group names to use when loading objects.- Specified by:
 removeFetchGroupsin interfaceFetchPlan
 
- 
removeFetchGroups
public FetchPlan removeFetchGroups(Collection groups)
Description copied from interface:FetchPlanRemovesgroupsfrom the set of fetch group names to use when loading objects.- Specified by:
 removeFetchGroupsin interfaceFetchPlan
 
- 
clearFetchGroups
public FetchPlan clearFetchGroups()
Description copied from interface:FetchPlanClears the set of fetch group names to use wen loading data. After this operation is invoked, only those fields in the default fetch group (and any requested field) will be loaded when loading an object.- Specified by:
 clearFetchGroupsin interfaceFetchPlan
 
- 
resetFetchGroups
public FetchPlan resetFetchGroups()
Description copied from interface:FetchPlanResets the set of fetch groups to the list in the global configuration.- Specified by:
 resetFetchGroupsin interfaceFetchPlan
 
- 
getFields
public Collection<String> getFields()
Description copied from interface:FetchPlanReturns the fully qualified names of the fields that this component will use when loading objects. Defaults to the empty set. 
- 
hasField
public boolean hasField(String field)
Description copied from interface:FetchPlanReturn true if the given field has been added. 
- 
hasField
public boolean hasField(Class cls, String field)
Description copied from interface:FetchPlanReturn true if the given field has been added. 
- 
addField
public FetchPlan addField(String field)
Description copied from interface:FetchPlanAddsfieldto the set of fully-qualified field names to use when loading objects. 
- 
addField
public FetchPlan addField(Class cls, String field)
Description copied from interface:FetchPlanAddsfieldto the set of field names to use when loading objects. 
- 
addFields
public FetchPlan addFields(String... fields)
Description copied from interface:FetchPlanAddsfieldsto the set of fully-qualified field names to use when loading objects. 
- 
addFields
public FetchPlan addFields(Class cls, String... fields)
Description copied from interface:FetchPlanAddsfieldsto the set of field names to use when loading objects. 
- 
addFields
public FetchPlan addFields(Collection fields)
Description copied from interface:FetchPlanAddsfieldsto the set of fully-qualified field names to use when loading objects. 
- 
addFields
public FetchPlan addFields(Class cls, Collection fields)
Description copied from interface:FetchPlanAddsfieldsto the set of field names to use when loading objects. 
- 
removeField
public FetchPlan removeField(String field)
Description copied from interface:FetchPlanRemove the given fully-qualified field.- Specified by:
 removeFieldin interfaceFetchPlan
 
- 
removeField
public FetchPlan removeField(Class cls, String field)
Description copied from interface:FetchPlanRemove the given field.- Specified by:
 removeFieldin interfaceFetchPlan
 
- 
removeFields
public FetchPlan removeFields(String... fields)
Description copied from interface:FetchPlanRemovesfieldsfrom the set of fully-qualified field names to use when loading objects.- Specified by:
 removeFieldsin interfaceFetchPlan
 
- 
removeFields
public FetchPlan removeFields(Class cls, String... fields)
Description copied from interface:FetchPlanRemovesfieldsfrom the set of field names to use when loading objects.- Specified by:
 removeFieldsin interfaceFetchPlan
 
- 
removeFields
public FetchPlan removeFields(Collection fields)
Description copied from interface:FetchPlanRemovesfieldsfrom the set of fully-qualified field names to use when loading objects.- Specified by:
 removeFieldsin interfaceFetchPlan
 
- 
removeFields
public FetchPlan removeFields(Class cls, Collection fields)
Description copied from interface:FetchPlanRemovesfieldsfrom the set of field names to use when loading objects.- Specified by:
 removeFieldsin interfaceFetchPlan
 
- 
clearFields
public FetchPlan clearFields()
Description copied from interface:FetchPlanClears the set of field names to use wen loading data. After this operation is invoked, only those fields in the configured fetch groups will be loaded when loading an object.- Specified by:
 clearFieldsin interfaceFetchPlan
 
- 
getLockTimeout
public int getLockTimeout()
Description copied from interface:FetchPlanThe number of milliseconds to wait for an object lock, or -1 for no limit.- Specified by:
 getLockTimeoutin interfaceFetchPlan
 
- 
setLockTimeout
public FetchPlan setLockTimeout(int timeout)
Description copied from interface:FetchPlanThe number of milliseconds to wait for an object lock, or -1 for no limit.- Specified by:
 setLockTimeoutin interfaceFetchPlan
 
- 
getLockScope
public jakarta.persistence.PessimisticLockScope getLockScope()
Description copied from interface:FetchPlanThe lock scope to use for locking loaded objects.- Specified by:
 getLockScopein interfaceFetchPlan
 
- 
setLockScope
public FetchPlan setLockScope(jakarta.persistence.PessimisticLockScope scope)
Description copied from interface:FetchPlanThe lock scope to use for locking loaded objects.- Specified by:
 setLockScopein interfaceFetchPlan
 
- 
getQueryTimeout
public int getQueryTimeout()
Description copied from interface:FetchPlanThe number of milliseconds to wait for a query, or -1 for no limit.- Specified by:
 getQueryTimeoutin interfaceFetchPlan
 
- 
setQueryTimeout
public FetchPlan setQueryTimeout(int timeout)
Description copied from interface:FetchPlanThe number of milliseconds to wait for a query, or -1 for no limit.- Specified by:
 setQueryTimeoutin interfaceFetchPlan
 
- 
getReadLockMode
public jakarta.persistence.LockModeType getReadLockMode()
Description copied from interface:FetchPlanThe lock level to use for locking loaded objects.- Specified by:
 getReadLockModein interfaceFetchPlan
 
- 
setReadLockMode
public FetchPlan setReadLockMode(jakarta.persistence.LockModeType mode)
Description copied from interface:FetchPlanThe lock level to use for locking loaded objects.- Specified by:
 setReadLockModein interfaceFetchPlan
 
- 
getWriteLockMode
public jakarta.persistence.LockModeType getWriteLockMode()
Description copied from interface:FetchPlanThe lock level to use for locking dirtied objects.- Specified by:
 getWriteLockModein interfaceFetchPlan
 
- 
setWriteLockMode
public FetchPlan setWriteLockMode(jakarta.persistence.LockModeType mode)
Description copied from interface:FetchPlanThe lock level to use for locking dirtied objects.- Specified by:
 setWriteLockModein interfaceFetchPlan
 
- 
getExtendedPathLookup
public boolean getExtendedPathLookup()
Description copied from interface:FetchPlanAffirms if extended path lookup feature is active.- Specified by:
 getExtendedPathLookupin interfaceFetchPlan
 
- 
setExtendedPathLookup
public FetchPlan setExtendedPathLookup(boolean flag)
Description copied from interface:FetchPlanSets extended path lookup feature.- Specified by:
 setExtendedPathLookupin interfaceFetchPlan
 
- 
getHint
public Object getHint(String key)
Description copied from interface:FetchPlanGet the hint value for the given key. 
- 
setHint
public void setHint(String key, Object value)
Sets the hint after converting the value appropriately. If a higher ranking equivalent hint is already set, then bypasses this hint. 
- 
getHints
public Map<String,Object> getHints()
Description copied from interface:FetchPlanGet the hints and their values currently set on this receiver. 
- 
getCacheRetrieveMode
public DataCacheRetrieveMode getCacheRetrieveMode()
Description copied from interface:FetchPlanGets the current retrieve mode for data cache.- Specified by:
 getCacheRetrieveModein interfaceFetchPlan
 
- 
getCacheStoreMode
public DataCacheStoreMode getCacheStoreMode()
Description copied from interface:FetchPlanGets the current storage mode for data cache.- Specified by:
 getCacheStoreModein interfaceFetchPlan
 
- 
setCacheStoreMode
public FetchPlan setCacheStoreMode(DataCacheStoreMode mode)
Description copied from interface:FetchPlanSets the current storage mode for data cache.- Specified by:
 setCacheStoreModein interfaceFetchPlan
 
- 
setCacheRetrieveMode
public FetchPlan setCacheRetrieveMode(DataCacheRetrieveMode mode)
Description copied from interface:FetchPlanSets the current retrieve mode for data cache.- Specified by:
 setCacheRetrieveModein interfaceFetchPlan
 
 - 
 
 -