Package org.apache.openjpa.persistence
Interface FetchPlan
- All Known Subinterfaces:
JDBCFetchPlan
- All Known Implementing Classes:
FetchPlanImpl,JDBCFetchPlanImpl
public interface FetchPlan
The fetch plan allows you to dynamically alter eager fetching
configuration and other aspects of data loading.
- Since:
- 0.4.1
- Author:
- Abe White, Pinaki Poddar
-
Field Summary
Fields -
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.Gets the current retrieve mode for data cache.Gets the current storage mode for data cache.Deprecated.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.booleanDeprecated.usegetQueryResultCacheEnabled()instead.booleanReturn 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.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.voidSet the hint for the given key to the given value.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) Deprecated.usesetQueryResultCacheEnabled(boolean)instead.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
-
GROUP_ALL
Fetch group representing all fields.- See Also:
-
GROUP_DEFAULT
The default fetch group.- See Also:
-
DEPTH_INFINITE
static final int DEPTH_INFINITEInfinite fetch depth.- See Also:
-
DEFAULT
static final int DEFAULTConstant to revert any setting to its default value.- See Also:
-
-
Method Details
-
getMaxFetchDepth
int getMaxFetchDepth()The maximum fetch depth when loading an object. -
setMaxFetchDepth
The maximum fetch depth when loading an object. -
getFetchBatchSize
int getFetchBatchSize()Return the fetch batch size for large result set support. Defaults to theopenjpa.FetchBatchSizesetting. Note that this property will be ignored under some data stores. -
setFetchBatchSize
Set the fetch batch size for large result set support. Defaults to theopenjpa.FetchBatchSizesetting. Note that this property will be ignored under some data stores. -
getQueryResultCacheEnabled
boolean getQueryResultCacheEnabled()Return 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.- Since:
- 1.0.0
-
setQueryResultCacheEnabled
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.- Since:
- 1.0.0
-
getQueryResultCache
Deprecated.usegetQueryResultCacheEnabled()instead. -
setQueryResultCache
Deprecated.usesetQueryResultCacheEnabled(boolean)instead. -
getFetchGroups
Collection<String> getFetchGroups()Returns the names of the fetch groups that this component will use when loading objects. Defaults to theopenjpa.FetchGroupssetting. -
addFetchGroup
Addsgroupto the set of fetch group to use when loading objects. -
addFetchGroups
Addsgroupsto the set of fetch group names to use when loading objects. -
addFetchGroups
Addsgroupsto the set of fetch group names to use when loading objects. -
removeFetchGroup
Remove the given fetch group. -
removeFetchGroups
Removesgroupsfrom the set of fetch group names to use when loading objects. -
removeFetchGroups
Removesgroupsfrom the set of fetch group names to use when loading objects. -
clearFetchGroups
FetchPlan clearFetchGroups()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. -
resetFetchGroups
FetchPlan resetFetchGroups()Resets the set of fetch groups to the list in the global configuration. -
getFields
Collection<String> getFields()Returns the fully qualified names of the fields that this component will use when loading objects. Defaults to the empty set. -
hasField
Return true if the given field has been added. -
hasField
Return true if the given field has been added. -
addField
Addsfieldto the set of fully-qualified field names to use when loading objects. -
addField
Addsfieldto the set of field names to use when loading objects. -
addFields
Addsfieldsto the set of fully-qualified field names to use when loading objects. -
addFields
Addsfieldsto the set of field names to use when loading objects. -
addFields
Addsfieldsto the set of fully-qualified field names to use when loading objects. -
addFields
Addsfieldsto the set of field names to use when loading objects. -
removeField
Remove the given fully-qualified field. -
removeField
Remove the given field. -
removeFields
Removesfieldsfrom the set of fully-qualified field names to use when loading objects. -
removeFields
Removesfieldsfrom the set of field names to use when loading objects. -
removeFields
Removesfieldsfrom the set of fully-qualified field names to use when loading objects. -
removeFields
Removesfieldsfrom the set of field names to use when loading objects. -
clearFields
FetchPlan clearFields()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. -
getLockTimeout
int getLockTimeout()The number of milliseconds to wait for an object lock, or -1 for no limit. -
setLockTimeout
The number of milliseconds to wait for an object lock, or -1 for no limit. -
getLockScope
jakarta.persistence.PessimisticLockScope getLockScope()The lock scope to use for locking loaded objects. -
setLockScope
The lock scope to use for locking loaded objects. -
getQueryTimeout
int getQueryTimeout()The number of milliseconds to wait for a query, or -1 for no limit. -
setQueryTimeout
The number of milliseconds to wait for a query, or -1 for no limit. -
getReadLockMode
jakarta.persistence.LockModeType getReadLockMode()The lock level to use for locking loaded objects. -
setReadLockMode
The lock level to use for locking loaded objects. -
getWriteLockMode
jakarta.persistence.LockModeType getWriteLockMode()The lock level to use for locking dirtied objects. -
setWriteLockMode
The lock level to use for locking dirtied objects. -
getDelegate
Deprecated.cast toFetchPlanImplinstead. This method pierces the published-API boundary, as does the SPI cast. -
getExtendedPathLookup
boolean getExtendedPathLookup()Affirms if extended path lookup feature is active.- Since:
- 2.0.0
-
setExtendedPathLookup
Sets extended path lookup feature.- Since:
- 2.0.0
-
getCacheStoreMode
DataCacheStoreMode getCacheStoreMode()Gets the current storage mode for data cache.- Since:
- 2.0.0
-
setCacheStoreMode
Sets the current storage mode for data cache.- Since:
- 2.0.0
-
getCacheRetrieveMode
DataCacheRetrieveMode getCacheRetrieveMode()Gets the current retrieve mode for data cache.- Since:
- 2.0.0
-
setCacheRetrieveMode
Sets the current retrieve mode for data cache.- Since:
- 2.0.0
-
setHint
Set the hint for the given key to the given value.- Parameters:
value- the value of the hint.name- the name of the hint.- Since:
- 2.0.0
-
getHints
Get the hints and their values currently set on this receiver.- Returns:
- empty map if no hint has been set.
-
getHint
Get the hint value for the given key.- Returns:
- null if the key has not been set.
-
FetchPlanImplinstead.