|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.kernel.FetchConfigurationImpl
public class FetchConfigurationImpl
Allows configuration and optimization of how objects are loaded from the data store.
Nested Class Summary | |
---|---|
protected static class |
FetchConfigurationImpl.ConfigurationState
Configurable state shared throughout a traversal chain. |
Field Summary |
---|
Fields inherited from interface org.apache.openjpa.kernel.FetchConfiguration |
---|
DEFAULT, FETCH_LOAD, FETCH_NONE, FETCH_REF |
Fields inherited from interface org.apache.openjpa.kernel.LockLevels |
---|
LOCK_NONE, LOCK_READ, LOCK_WRITE |
Fields inherited from interface org.apache.openjpa.kernel.QueryFlushModes |
---|
FLUSH_FALSE, FLUSH_TRUE, FLUSH_WITH_CONNECTION |
Constructor Summary | |
---|---|
|
FetchConfigurationImpl()
|
protected |
FetchConfigurationImpl(FetchConfigurationImpl.ConfigurationState state)
|
Method Summary | |
---|---|
FetchConfiguration |
addFetchGroup(String name)
Adds group to the set of fetch group names to
use when loading objects. |
FetchConfiguration |
addFetchGroups(Collection groups)
Adds groups to the set of fetch group names to
use when loading objects. |
FetchConfiguration |
addField(String field)
Adds field to the set of fully-qualified field names to
use when loading objects. |
FetchConfiguration |
addFields(Collection fields)
Adds fields to the set of fully-qualified field names to
use when loading objects. |
FetchConfiguration |
clearFetchGroups()
Clears the set of fetch group names to use when loading data. |
FetchConfiguration |
clearFields()
Clears the set of field names to use when loading data. |
Object |
clone()
Clone this instance. |
void |
copy(FetchConfiguration fetch)
Copy the state from the given fetch configuration to this one. |
StoreContext |
getContext()
Return the context assiciated with this configuration; may be null if it has not been set or this object has been serialized. |
int |
getFetchBatchSize()
Return the fetch batch size for large result set support. |
Set |
getFetchGroups()
Returns immutable set of names of the fetch groups that this component will use when loading objects. |
Set |
getFields()
Returns the set of fully-qualified field names that this component will use when loading objects. |
int |
getFlushBeforeQueries()
The query automatic flush configuration. |
Object |
getHint(String name)
Returns the hint for the specific key, or null if the hint is not specified. |
int |
getLockTimeout()
The number of milliseconds to wait for an object lock, or -1 for no limit. |
int |
getMaxFetchDepth()
Return the maximum depth of fetched instance graph. |
boolean |
getQueryCacheEnabled()
Return whether or not query caching is enabled. |
int |
getReadLockLevel()
The lock level to use for locking loaded objects. |
Set |
getRootClasses()
Root classes for recursive operations. |
Set |
getRootInstances()
Root instances for recursive operations. |
int |
getWriteLockLevel()
The lock level to use for locking dirtied objects. |
boolean |
hasFetchGroup(String group)
Return true if the given fetch group has been added. |
boolean |
hasField(String field)
Return true if the given fully-qualified field has been added. |
void |
lock()
Synchronize on internal lock if multithreaded is true. |
protected FetchConfigurationImpl |
newInstance(FetchConfigurationImpl.ConfigurationState state)
Return a new hollow instance. |
ResultList |
newResultList(ResultObjectProvider rop)
Return a new result list for the current fetch configuration. |
FetchConfiguration |
removeFetchGroup(String group)
Remove the given fetch group. |
FetchConfiguration |
removeFetchGroups(Collection groups)
Removes groups from the set of fetch group names
to use when loading objects. |
FetchConfiguration |
removeField(String field)
Remove the given fully-qualified field. |
FetchConfiguration |
removeFields(Collection fields)
Removes fields from the set of fully-qualified field names
to use when loading objects. |
int |
requiresFetch(FieldMetaData fm)
Affirms if the given field requires to be fetched in the context of current fetch operation. |
boolean |
requiresLoad()
Return false if we know that the object being fetched with this configuration does not require a load, because this configuration came from a traversal of a FetchConfiguration.FETCH_REF field. |
FetchConfiguration |
resetFetchGroups()
Resets the set of fetch groups to the list in the global configuration. |
void |
setContext(StoreContext ctx)
Called automatically by the system to associate the fetch configuration with a context before use. |
FetchConfiguration |
setFetchBatchSize(int fetchBatchSize)
Set the fetch batch size for large result set support. |
FetchConfiguration |
setFlushBeforeQueries(int flush)
The query automatic flush configuration. |
void |
setHint(String name,
Object value)
Sets an arbitrary query hint that may be utilized during execution. |
FetchConfiguration |
setLockTimeout(int timeout)
The number of milliseconds to wait for an object lock, or -1 for no limit. |
FetchConfiguration |
setMaxFetchDepth(int depth)
Set the maximum depth of the fetched instance graph. |
FetchConfiguration |
setQueryCacheEnabled(boolean cache)
Control whether or not query caching is enabled. |
FetchConfiguration |
setReadLockLevel(int level)
The lock level to use for locking loaded objects. |
FetchConfiguration |
setRootClasses(Collection classes)
Root classes for recursive operations. |
FetchConfiguration |
setRootInstances(Collection instances)
Root instances for recursive operations. |
FetchConfiguration |
setWriteLockLevel(int level)
The lock level to use for locking dirtied objects. |
String |
toString()
|
FetchConfiguration |
traverse(FieldMetaData fm)
Traverse the given field to generate (possibly) a new configuration state. |
void |
unlock()
Release internal lock if multithreaded is true. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FetchConfigurationImpl()
protected FetchConfigurationImpl(FetchConfigurationImpl.ConfigurationState state)
Method Detail |
---|
public StoreContext getContext()
FetchConfiguration
getContext
in interface FetchConfiguration
public void setContext(StoreContext ctx)
FetchConfiguration
setContext
in interface FetchConfiguration
public Object clone()
clone
in interface FetchConfiguration
clone
in class Object
protected FetchConfigurationImpl newInstance(FetchConfigurationImpl.ConfigurationState state)
public void copy(FetchConfiguration fetch)
FetchConfiguration
copy
in interface FetchConfiguration
public int getFetchBatchSize()
FetchConfiguration
openjpa.FetchBatchSize
setting. Note
that this property will be ignored under some data stores.
getFetchBatchSize
in interface FetchConfiguration
public FetchConfiguration setFetchBatchSize(int fetchBatchSize)
FetchConfiguration
openjpa.FetchBatchSize
setting. Note
that this property will be ignored under some data stores.
setFetchBatchSize
in interface FetchConfiguration
public int getMaxFetchDepth()
FetchConfiguration
1
getMaxFetchDepth
in interface FetchConfiguration
public FetchConfiguration setMaxFetchDepth(int depth)
FetchConfiguration
setMaxFetchDepth
in interface FetchConfiguration
depth
- denotes limiting length of traversal path from a root
instance. -1
implies no limit. 0
is not
permissible.public boolean getQueryCacheEnabled()
FetchConfiguration
true
but the datacache plugin is not installed, caching
will not be enabled. If this
returns false
, query caching will not be used
even if the datacache plugin is installed.
getQueryCacheEnabled
in interface FetchConfiguration
public FetchConfiguration setQueryCacheEnabled(boolean cache)
FetchConfiguration
setQueryCacheEnabled
in interface FetchConfiguration
public int getFlushBeforeQueries()
FetchConfiguration
getFlushBeforeQueries
in interface FetchConfiguration
public FetchConfiguration setFlushBeforeQueries(int flush)
FetchConfiguration
setFlushBeforeQueries
in interface FetchConfiguration
public Set getFetchGroups()
FetchConfiguration
openjpa.FetchGroups
setting. This set is not thread safe.
getFetchGroups
in interface FetchConfiguration
public boolean hasFetchGroup(String group)
FetchConfiguration
hasFetchGroup
in interface FetchConfiguration
public FetchConfiguration addFetchGroup(String name)
FetchConfiguration
group
to the set of fetch group names to
use when loading objects.
addFetchGroup
in interface FetchConfiguration
public FetchConfiguration addFetchGroups(Collection groups)
FetchConfiguration
groups
to the set of fetch group names to
use when loading objects.
addFetchGroups
in interface FetchConfiguration
public FetchConfiguration removeFetchGroup(String group)
FetchConfiguration
removeFetchGroup
in interface FetchConfiguration
public FetchConfiguration removeFetchGroups(Collection groups)
FetchConfiguration
groups
from the set of fetch group names
to use when loading objects.
removeFetchGroups
in interface FetchConfiguration
public FetchConfiguration clearFetchGroups()
FetchConfiguration
clearFetchGroups
in interface FetchConfiguration
public FetchConfiguration resetFetchGroups()
FetchConfiguration
resetFetchGroups
in interface FetchConfiguration
public Set getFields()
FetchConfiguration
getFields
in interface FetchConfiguration
public boolean hasField(String field)
FetchConfiguration
hasField
in interface FetchConfiguration
public FetchConfiguration addField(String field)
FetchConfiguration
field
to the set of fully-qualified field names to
use when loading objects.
addField
in interface FetchConfiguration
public FetchConfiguration addFields(Collection fields)
FetchConfiguration
fields
to the set of fully-qualified field names to
use when loading objects.
addFields
in interface FetchConfiguration
public FetchConfiguration removeField(String field)
FetchConfiguration
removeField
in interface FetchConfiguration
public FetchConfiguration removeFields(Collection fields)
FetchConfiguration
fields
from the set of fully-qualified field names
to use when loading objects.
removeFields
in interface FetchConfiguration
public FetchConfiguration clearFields()
FetchConfiguration
clearFields
in interface FetchConfiguration
public int getLockTimeout()
FetchConfiguration
getLockTimeout
in interface FetchConfiguration
public FetchConfiguration setLockTimeout(int timeout)
FetchConfiguration
setLockTimeout
in interface FetchConfiguration
public int getReadLockLevel()
FetchConfiguration
getReadLockLevel
in interface FetchConfiguration
public FetchConfiguration setReadLockLevel(int level)
FetchConfiguration
setReadLockLevel
in interface FetchConfiguration
public int getWriteLockLevel()
FetchConfiguration
getWriteLockLevel
in interface FetchConfiguration
public FetchConfiguration setWriteLockLevel(int level)
FetchConfiguration
setWriteLockLevel
in interface FetchConfiguration
public ResultList newResultList(ResultObjectProvider rop)
FetchConfiguration
newResultList
in interface FetchConfiguration
public void setHint(String name, Object value)
FetchConfiguration
setHint
in interface FetchConfiguration
name
- the name of the hintvalue
- the value of the hintpublic Object getHint(String name)
FetchConfiguration
getHint
in interface FetchConfiguration
name
- the hint namepublic Set getRootClasses()
FetchConfiguration
getRootClasses
in interface FetchConfiguration
public FetchConfiguration setRootClasses(Collection classes)
FetchConfiguration
setRootClasses
in interface FetchConfiguration
public Set getRootInstances()
FetchConfiguration
getRootInstances
in interface FetchConfiguration
public FetchConfiguration setRootInstances(Collection instances)
FetchConfiguration
setRootInstances
in interface FetchConfiguration
public void lock()
FetchConfiguration
lock
in interface FetchConfiguration
public void unlock()
FetchConfiguration
unlock
in interface FetchConfiguration
public int requiresFetch(FieldMetaData fm)
FetchConfiguration
FetchConfiguration.FETCH_NONE
,
FetchConfiguration.FETCH_LOAD
, FETCH_REF
.
requiresFetch
in interface FetchConfiguration
public boolean requiresLoad()
FetchConfiguration
FetchConfiguration.FETCH_REF
field.
requiresLoad
in interface FetchConfiguration
public FetchConfiguration traverse(FieldMetaData fm)
FetchConfiguration
traverse
in interface FetchConfiguration
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |