Package org.apache.openjpa.persistence
Class FetchPlanImpl
java.lang.Object
org.apache.openjpa.persistence.FetchPlanImpl
- All Implemented Interfaces:
FetchPlan
- Direct Known Subclasses:
JDBCFetchPlanImpl
Implements FetchPlan via delegation to FetchConfiguration.
- Since:
- 0.4.1
- Author:
- Abe White, Pinaki Poddar
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static Map<String,HintValueConverter[]> Structure holds one or more converters for a user-specified hint value.Structure 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 -
Method Summary
Modifier and TypeMethodDescriptionaddFetchGroup(String group) Addsgroupto the set of fetch group to use when loading objects.addFetchGroups(String... groups) Addsgroupsto the set of fetch group names to use when loading objects.addFetchGroups(Collection groups) Addsgroupsto the set of fetch group names to use when loading objects.Addsfieldto the set of field names to use when loading objects.Addsfieldto the set of fully-qualified field names to use when loading objects.Addsfieldsto the set of field names to use when loading objects.addFields(Class cls, Collection fields) Addsfieldsto the set of field names to use when loading objects.Addsfieldsto the set of fully-qualified field names to use when loading objects.addFields(Collection fields) Addsfieldsto the set of fully-qualified field names to use when loading objects.Clears the set of fetch group names to use wen loading data.Clears the set of field names to use wen loading data.booleanGets the current retrieve mode for data cache.Gets the current storage mode for data cache.Delegate.booleanAffirms if extended path lookup feature is active.intReturn the fetch batch size for large result set support.Returns the names of the fetch groups that this component will use when loading objects.Returns the fully qualified names of the fields that this component will use when loading objects.Get the hint value for the given key.getHints()Get the hints and their values currently set on this receiver.jakarta.persistence.PessimisticLockScopeThe lock scope to use for locking loaded objects.intThe number of milliseconds to wait for an object lock, or -1 for no limit.intThe maximum fetch depth when loading an object.booleanbooleanReturn whether or not query caching is enabled.intThe number of milliseconds to wait for a query, or -1 for no limit.jakarta.persistence.LockModeTypeThe lock level to use for locking loaded objects.jakarta.persistence.LockModeTypeThe lock level to use for locking dirtied objects.booleanReturn true if the given field has been added.booleanReturn true if the given field has been added.inthashCode()protected DelegatingFetchConfigurationCreate a new exception-translating delegating fetch configuration.protected static voidregisterHint(String[] keys, HintValueConverter... converters) Registers a hint key with its value converters.removeFetchGroup(String group) Remove the given fetch group.removeFetchGroups(String... groups) Removesgroupsfrom the set of fetch group names to use when loading objects.removeFetchGroups(Collection groups) Removesgroupsfrom the set of fetch group names to use when loading objects.removeField(Class cls, String field) Remove the given field.removeField(String field) Remove the given fully-qualified field.removeFields(Class cls, String... fields) Removesfieldsfrom the set of field names to use when loading objects.removeFields(Class cls, Collection fields) Removesfieldsfrom the set of field names to use when loading objects.removeFields(String... fields) Removesfieldsfrom the set of fully-qualified field names to use when loading objects.removeFields(Collection fields) Removesfieldsfrom the set of fully-qualified field names to use when loading objects.Resets the set of fetch groups to the list in the global configuration.Sets the current retrieve mode for data cache.Sets the current storage mode for data cache.setExtendedPathLookup(boolean flag) Sets extended path lookup feature.setFetchBatchSize(int fetchBatchSize) Set the fetch batch size for large result set support.voidSets the hint after converting the value appropriately.voidsetLockScope(jakarta.persistence.PessimisticLockScope scope) The lock scope to use for locking loaded objects.setLockTimeout(int timeout) The number of milliseconds to wait for an object lock, or -1 for no limit.setMaxFetchDepth(int depth) The maximum fetch depth when loading an object.setQueryResultCache(boolean cache) setQueryResultCacheEnabled(boolean cache) Control whether or not query caching is enabled.setQueryTimeout(int timeout) The number of milliseconds to wait for a query, or -1 for no limit.setReadLockMode(jakarta.persistence.LockModeType mode) The lock level to use for locking loaded objects.setWriteLockMode(jakarta.persistence.LockModeType mode) The lock level to use for locking dirtied objects.
-
Field Details
-
_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
Structure holds one or more converters for a user-specified hint value.
-
-
Constructor Details
-
FetchPlanImpl
Constructor; supply delegate.
-
-
Method Details
-
registerHint
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
Create a new exception-translating delegating fetch configuration. -
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
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
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
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
- Specified by:
setQueryResultCachein interfaceFetchPlan
-
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
Description copied from interface:FetchPlanAddsgroupto the set of fetch group to use when loading objects.- Specified by:
addFetchGroupin interfaceFetchPlan
-
addFetchGroups
Description copied from interface:FetchPlanAddsgroupsto the set of fetch group names to use when loading objects.- Specified by:
addFetchGroupsin interfaceFetchPlan
-
addFetchGroups
Description copied from interface:FetchPlanAddsgroupsto the set of fetch group names to use when loading objects.- Specified by:
addFetchGroupsin interfaceFetchPlan
-
removeFetchGroup
Description copied from interface:FetchPlanRemove the given fetch group.- Specified by:
removeFetchGroupin interfaceFetchPlan
-
removeFetchGroups
Description copied from interface:FetchPlanRemovesgroupsfrom the set of fetch group names to use when loading objects.- Specified by:
removeFetchGroupsin interfaceFetchPlan
-
removeFetchGroups
Description copied from interface:FetchPlanRemovesgroupsfrom the set of fetch group names to use when loading objects.- Specified by:
removeFetchGroupsin interfaceFetchPlan
-
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
Description copied from interface:FetchPlanResets the set of fetch groups to the list in the global configuration.- Specified by:
resetFetchGroupsin interfaceFetchPlan
-
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
Description copied from interface:FetchPlanReturn true if the given field has been added. -
hasField
Description copied from interface:FetchPlanReturn true if the given field has been added. -
addField
Description copied from interface:FetchPlanAddsfieldto the set of fully-qualified field names to use when loading objects. -
addField
Description copied from interface:FetchPlanAddsfieldto the set of field names to use when loading objects. -
addFields
Description copied from interface:FetchPlanAddsfieldsto the set of fully-qualified field names to use when loading objects. -
addFields
Description copied from interface:FetchPlanAddsfieldsto the set of field names to use when loading objects. -
addFields
Description copied from interface:FetchPlanAddsfieldsto the set of fully-qualified field names to use when loading objects. -
addFields
Description copied from interface:FetchPlanAddsfieldsto the set of field names to use when loading objects. -
removeField
Description copied from interface:FetchPlanRemove the given fully-qualified field.- Specified by:
removeFieldin interfaceFetchPlan
-
removeField
Description copied from interface:FetchPlanRemove the given field.- Specified by:
removeFieldin interfaceFetchPlan
-
removeFields
Description copied from interface:FetchPlanRemovesfieldsfrom the set of fully-qualified field names to use when loading objects.- Specified by:
removeFieldsin interfaceFetchPlan
-
removeFields
Description copied from interface:FetchPlanRemovesfieldsfrom the set of field names to use when loading objects.- Specified by:
removeFieldsin interfaceFetchPlan
-
removeFields
Description copied from interface:FetchPlanRemovesfieldsfrom the set of fully-qualified field names to use when loading objects.- Specified by:
removeFieldsin interfaceFetchPlan
-
removeFields
Description copied from interface:FetchPlanRemovesfieldsfrom the set of field names to use when loading objects.- Specified by:
removeFieldsin interfaceFetchPlan
-
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
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
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
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
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
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
Description copied from interface:FetchPlanSets extended path lookup feature.- Specified by:
setExtendedPathLookupin interfaceFetchPlan
-
getHint
Description copied from interface:FetchPlanGet the hint value for the given key. -
setHint
Sets the hint after converting the value appropriately. If a higher ranking equivalent hint is already set, then bypasses this hint. -
setHints
-
getHints
Description copied from interface:FetchPlanGet the hints and their values currently set on this receiver. -
hashCode
public int hashCode() -
equals
-
getCacheRetrieveMode
Description copied from interface:FetchPlanGets the current retrieve mode for data cache.- Specified by:
getCacheRetrieveModein interfaceFetchPlan
-
getCacheStoreMode
Description copied from interface:FetchPlanGets the current storage mode for data cache.- Specified by:
getCacheStoreModein interfaceFetchPlan
-
setCacheStoreMode
Description copied from interface:FetchPlanSets the current storage mode for data cache.- Specified by:
setCacheStoreModein interfaceFetchPlan
-
setCacheRetrieveMode
Description copied from interface:FetchPlanSets the current retrieve mode for data cache.- Specified by:
setCacheRetrieveModein interfaceFetchPlan
-