org.apache.openjpa.kernel
Class ROPStoreManager
java.lang.Object
org.apache.openjpa.kernel.DelegatingStoreManager
org.apache.openjpa.kernel.ROPStoreManager
- All Implemented Interfaces:
- StoreManager, Closeable
class ROPStoreManager
- extends DelegatingStoreManager
Wraps the native store manager to handle calls using custom
PCResultObjectProvider
s.
- Author:
- Abe White
Methods inherited from class org.apache.openjpa.kernel.DelegatingStoreManager |
assignField, assignObjectId, beforeStateChange, begin, beginOptimistic, cancelAll, close, commit, compareVersion, copyDataStoreId, equals, executeExtent, flush, getClientConnection, getDataStoreIdSequence, getDataStoreIdType, getDelegate, getInnermostDelegate, getManagedType, getValueSequence, hashCode, isCached, loadAll, newDataStoreId, newFetchConfiguration, newQuery, releaseConnection, retainConnection, rollback, rollbackOptimistic, setContext |
ROPStoreManager
public ROPStoreManager(StoreManager delegate)
exists
public boolean exists(OpenJPAStateManager sm,
Object context)
- Description copied from interface:
StoreManager
- Verify that the given instance exists in the data store; return false
if it does not.
- Specified by:
exists
in interface StoreManager
- Overrides:
exists
in class DelegatingStoreManager
initialize
public boolean initialize(OpenJPAStateManager sm,
PCState state,
FetchConfiguration fetch,
Object context)
- Description copied from interface:
StoreManager
- Initialize the given state manager. The object id of the
state manager will be set, and the state manager's metadata be set to
the class of the instance to load, or possibly one of its superclasses.
Initialization involves first calling the
OpenJPAStateManager.initialize(java.lang.Class, org.apache.openjpa.kernel.PCState)
method with
a new instance of the correct type constructed with the
PCRegistry.newInstance(Class,
org.apache.openjpa.enhance.StateManager, boolean)
method
(this will reset the state manager's metadata if the actual type was a
subclass). After instance initialization, load any the fields for the
given fetch configuration that can be efficiently retrieved. If any of
the configured fields are not loaded in this method, they will be
loaded with a subsequent call to StoreManager.load(org.apache.openjpa.kernel.OpenJPAStateManager, java.util.BitSet, org.apache.openjpa.kernel.FetchConfiguration, int, java.lang.Object)
. If this method is
called during a data store transaction, the instance's database record
should be locked. Version information can be loaded if desired through
the OpenJPAStateManager.setVersion(java.lang.Object)
method.
- Specified by:
initialize
in interface StoreManager
- Overrides:
initialize
in class DelegatingStoreManager
- Parameters:
sm
- the instance to initializestate
- the lifecycle state to initialize the state manager withfetch
- configuration for how to load the instancecontext
- the current execution data, or null if not
given to the calling method of the broker
- Returns:
- true if the matching instance exists in the data
store, false otherwise
syncVersion
public boolean syncVersion(OpenJPAStateManager sm,
Object context)
- Description copied from interface:
StoreManager
- Update the version information in the given state manager to the
version stored in the data store.
- Specified by:
syncVersion
in interface StoreManager
- Overrides:
syncVersion
in class DelegatingStoreManager
- Parameters:
sm
- the instance to checkcontext
- the current execution data, or null if not
given to the calling method of the context
- Returns:
- true if the instance still exists in the
datastore and is up-to-date, false otherwise
load
public boolean load(OpenJPAStateManager sm,
BitSet fields,
FetchConfiguration fetch,
int lockLevel,
Object context)
- Description copied from interface:
StoreManager
- Load the given state manager.
Note that any collection or map types loaded into the state manager
will be proxied with the correct type; therefore the store manager
does not have to load the same concrete collection/map types as the
instance declares. However, array types must be consistent with the
array type stored by the persistence capable instance. If this method
is called during a data store transaction, the instance should be
locked. If the given state manager does not have its version set
already, version information can be loaded if desired through the
OpenJPAStateManager.setVersion(java.lang.Object)
method.
- Specified by:
load
in interface StoreManager
- Overrides:
load
in class DelegatingStoreManager
- Parameters:
sm
- the instance to loadfields
- set of fields to load; all field indexes in this
set must be loaded; this set is mutablefetch
- the fetch configuration to use when loading
related objectslockLevel
- attempt to load simple fields at this lock level;
relations should be loaded at the read lock level
of the fetch configurationcontext
- the current execution data, or null if not
given to the calling method of the broker
- Returns:
- false if the object no longer exists in the
database, true otherwise
Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.