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
Modifier 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
-
Method Summary
Modifier and TypeMethodDescriptionaddFetchGroup
(String group) Addsgroup
to the set of fetch group to use when loading objects.addFetchGroups
(String... groups) Addsgroups
to the set of fetch group names to use when loading objects.addFetchGroups
(Collection groups) Addsgroups
to the set of fetch group names to use when loading objects.Addsfield
to the set of field names to use when loading objects.Addsfield
to the set of fully-qualified field names to use when loading objects.Addsfields
to the set of field names to use when loading objects.addFields
(Class cls, Collection fields) Addsfields
to the set of field names to use when loading objects.Addsfields
to the set of fully-qualified field names to use when loading objects.addFields
(Collection fields) Addsfields
to 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.boolean
Gets the current retrieve mode for data cache.Gets the current storage mode for data cache.Delegate.boolean
Affirms if extended path lookup feature is active.int
Return 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.PessimisticLockScope
The lock scope to use for locking loaded objects.int
The number of milliseconds to wait for an object lock, or -1 for no limit.int
The maximum fetch depth when loading an object.boolean
boolean
Return whether or not query caching is enabled.int
The number of milliseconds to wait for a query, or -1 for no limit.jakarta.persistence.LockModeType
The lock level to use for locking loaded objects.jakarta.persistence.LockModeType
The lock level to use for locking dirtied objects.boolean
Return true if the given field has been added.boolean
Return true if the given field has been added.int
hashCode()
protected DelegatingFetchConfiguration
Create a new exception-translating delegating fetch configuration.protected static void
registerHint
(String[] keys, HintValueConverter... converters) Registers a hint key with its value converters.removeFetchGroup
(String group) Remove the given fetch group.removeFetchGroups
(String... groups) Removesgroups
from the set of fetch group names to use when loading objects.removeFetchGroups
(Collection groups) Removesgroups
from 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) Removesfields
from the set of field names to use when loading objects.removeFields
(Class cls, Collection fields) Removesfields
from the set of field names to use when loading objects.removeFields
(String... fields) Removesfields
from the set of fully-qualified field names to use when loading objects.removeFields
(Collection fields) Removesfields
from 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.void
Sets the hint after converting the value appropriately.void
setLockScope
(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:
getDelegate
in interfaceFetchPlan
-
getMaxFetchDepth
public int getMaxFetchDepth()Description copied from interface:FetchPlan
The maximum fetch depth when loading an object.- Specified by:
getMaxFetchDepth
in interfaceFetchPlan
-
setMaxFetchDepth
Description copied from interface:FetchPlan
The maximum fetch depth when loading an object.- Specified by:
setMaxFetchDepth
in interfaceFetchPlan
-
getFetchBatchSize
public int getFetchBatchSize()Description copied from interface:FetchPlan
Return the fetch batch size for large result set support. Defaults to theopenjpa.FetchBatchSize
setting. Note that this property will be ignored under some data stores.- Specified by:
getFetchBatchSize
in interfaceFetchPlan
-
setFetchBatchSize
Description copied from interface:FetchPlan
Set the fetch batch size for large result set support. Defaults to theopenjpa.FetchBatchSize
setting. Note that this property will be ignored under some data stores.- Specified by:
setFetchBatchSize
in interfaceFetchPlan
-
getQueryResultCacheEnabled
public boolean getQueryResultCacheEnabled()Description copied from interface:FetchPlan
Return whether or not query caching is enabled. If this returnstrue
but 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:
getQueryResultCacheEnabled
in interfaceFetchPlan
-
setQueryResultCacheEnabled
Description copied from interface:FetchPlan
Control 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:
setQueryResultCacheEnabled
in interfaceFetchPlan
-
getQueryResultCache
public boolean getQueryResultCache()- Specified by:
getQueryResultCache
in interfaceFetchPlan
-
setQueryResultCache
- Specified by:
setQueryResultCache
in interfaceFetchPlan
-
getFetchGroups
Description copied from interface:FetchPlan
Returns the names of the fetch groups that this component will use when loading objects. Defaults to theopenjpa.FetchGroups
setting.- Specified by:
getFetchGroups
in interfaceFetchPlan
-
addFetchGroup
Description copied from interface:FetchPlan
Addsgroup
to the set of fetch group to use when loading objects.- Specified by:
addFetchGroup
in interfaceFetchPlan
-
addFetchGroups
Description copied from interface:FetchPlan
Addsgroups
to the set of fetch group names to use when loading objects.- Specified by:
addFetchGroups
in interfaceFetchPlan
-
addFetchGroups
Description copied from interface:FetchPlan
Addsgroups
to the set of fetch group names to use when loading objects.- Specified by:
addFetchGroups
in interfaceFetchPlan
-
removeFetchGroup
Description copied from interface:FetchPlan
Remove the given fetch group.- Specified by:
removeFetchGroup
in interfaceFetchPlan
-
removeFetchGroups
Description copied from interface:FetchPlan
Removesgroups
from the set of fetch group names to use when loading objects.- Specified by:
removeFetchGroups
in interfaceFetchPlan
-
removeFetchGroups
Description copied from interface:FetchPlan
Removesgroups
from the set of fetch group names to use when loading objects.- Specified by:
removeFetchGroups
in interfaceFetchPlan
-
clearFetchGroups
Description copied from interface:FetchPlan
Clears 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:
clearFetchGroups
in interfaceFetchPlan
-
resetFetchGroups
Description copied from interface:FetchPlan
Resets the set of fetch groups to the list in the global configuration.- Specified by:
resetFetchGroups
in interfaceFetchPlan
-
getFields
Description copied from interface:FetchPlan
Returns 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:FetchPlan
Return true if the given field has been added. -
hasField
Description copied from interface:FetchPlan
Return true if the given field has been added. -
addField
Description copied from interface:FetchPlan
Addsfield
to the set of fully-qualified field names to use when loading objects. -
addField
Description copied from interface:FetchPlan
Addsfield
to the set of field names to use when loading objects. -
addFields
Description copied from interface:FetchPlan
Addsfields
to the set of fully-qualified field names to use when loading objects. -
addFields
Description copied from interface:FetchPlan
Addsfields
to the set of field names to use when loading objects. -
addFields
Description copied from interface:FetchPlan
Addsfields
to the set of fully-qualified field names to use when loading objects. -
addFields
Description copied from interface:FetchPlan
Addsfields
to the set of field names to use when loading objects. -
removeField
Description copied from interface:FetchPlan
Remove the given fully-qualified field.- Specified by:
removeField
in interfaceFetchPlan
-
removeField
Description copied from interface:FetchPlan
Remove the given field.- Specified by:
removeField
in interfaceFetchPlan
-
removeFields
Description copied from interface:FetchPlan
Removesfields
from the set of fully-qualified field names to use when loading objects.- Specified by:
removeFields
in interfaceFetchPlan
-
removeFields
Description copied from interface:FetchPlan
Removesfields
from the set of field names to use when loading objects.- Specified by:
removeFields
in interfaceFetchPlan
-
removeFields
Description copied from interface:FetchPlan
Removesfields
from the set of fully-qualified field names to use when loading objects.- Specified by:
removeFields
in interfaceFetchPlan
-
removeFields
Description copied from interface:FetchPlan
Removesfields
from the set of field names to use when loading objects.- Specified by:
removeFields
in interfaceFetchPlan
-
clearFields
Description copied from interface:FetchPlan
Clears 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:
clearFields
in interfaceFetchPlan
-
getLockTimeout
public int getLockTimeout()Description copied from interface:FetchPlan
The number of milliseconds to wait for an object lock, or -1 for no limit.- Specified by:
getLockTimeout
in interfaceFetchPlan
-
setLockTimeout
Description copied from interface:FetchPlan
The number of milliseconds to wait for an object lock, or -1 for no limit.- Specified by:
setLockTimeout
in interfaceFetchPlan
-
getLockScope
public jakarta.persistence.PessimisticLockScope getLockScope()Description copied from interface:FetchPlan
The lock scope to use for locking loaded objects.- Specified by:
getLockScope
in interfaceFetchPlan
-
setLockScope
Description copied from interface:FetchPlan
The lock scope to use for locking loaded objects.- Specified by:
setLockScope
in interfaceFetchPlan
-
getQueryTimeout
public int getQueryTimeout()Description copied from interface:FetchPlan
The number of milliseconds to wait for a query, or -1 for no limit.- Specified by:
getQueryTimeout
in interfaceFetchPlan
-
setQueryTimeout
Description copied from interface:FetchPlan
The number of milliseconds to wait for a query, or -1 for no limit.- Specified by:
setQueryTimeout
in interfaceFetchPlan
-
getReadLockMode
public jakarta.persistence.LockModeType getReadLockMode()Description copied from interface:FetchPlan
The lock level to use for locking loaded objects.- Specified by:
getReadLockMode
in interfaceFetchPlan
-
setReadLockMode
Description copied from interface:FetchPlan
The lock level to use for locking loaded objects.- Specified by:
setReadLockMode
in interfaceFetchPlan
-
getWriteLockMode
public jakarta.persistence.LockModeType getWriteLockMode()Description copied from interface:FetchPlan
The lock level to use for locking dirtied objects.- Specified by:
getWriteLockMode
in interfaceFetchPlan
-
setWriteLockMode
Description copied from interface:FetchPlan
The lock level to use for locking dirtied objects.- Specified by:
setWriteLockMode
in interfaceFetchPlan
-
getExtendedPathLookup
public boolean getExtendedPathLookup()Description copied from interface:FetchPlan
Affirms if extended path lookup feature is active.- Specified by:
getExtendedPathLookup
in interfaceFetchPlan
-
setExtendedPathLookup
Description copied from interface:FetchPlan
Sets extended path lookup feature.- Specified by:
setExtendedPathLookup
in interfaceFetchPlan
-
getHint
Description copied from interface:FetchPlan
Get 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:FetchPlan
Get the hints and their values currently set on this receiver. -
hashCode
public int hashCode() -
equals
-
getCacheRetrieveMode
Description copied from interface:FetchPlan
Gets the current retrieve mode for data cache.- Specified by:
getCacheRetrieveMode
in interfaceFetchPlan
-
getCacheStoreMode
Description copied from interface:FetchPlan
Gets the current storage mode for data cache.- Specified by:
getCacheStoreMode
in interfaceFetchPlan
-
setCacheStoreMode
Description copied from interface:FetchPlan
Sets the current storage mode for data cache.- Specified by:
setCacheStoreMode
in interfaceFetchPlan
-
setCacheRetrieveMode
Description copied from interface:FetchPlan
Sets the current retrieve mode for data cache.- Specified by:
setCacheRetrieveMode
in interfaceFetchPlan
-