|
SolarMetric Kodo JDO 3.3.5 generated on August 31 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kodo.runtime.PersistenceManagerImpl
Concrete PersistenceManager
for use with
this common runtime. The PersistenceManager handles JDO-specific
behavior, but leaves all interaction with the data store to
a StoreManager
that must be supplied at initialization.
All options defined in the JDO 1.0 specification are supported, with the exception of non durable identity and changing primary keys.
Field Summary | |
protected static int |
FLUSH_COMMIT
Flush in preparation of commit. |
protected static int |
FLUSH_INC
Incremental flush. |
protected static int |
FLUSH_LOGICAL
Run persistence-by-reachability and other flush-time operations without accessing the database. |
protected static int |
FLUSH_ROLLBACK
Flush to check consistency of cache, then immediately rollback changes. |
Fields inherited from interface kodo.runtime.KodoPersistenceManagerSPI |
EXCLUDE_ALL, OID_ALLOW_NEW, OID_COPY, OID_VALIDATE |
Fields inherited from interface kodo.runtime.KodoPersistenceManager |
CONN_RETAIN_DEMAND, CONN_RETAIN_PM, CONN_RETAIN_TRANS, DETACH_ALL, DETACH_FGS, DETACH_LOADED, LOCK_NONE, LOCK_READ, LOCK_WRITE, LOOKUP_CHECK, LOOKUP_HOLLOW |
Constructor Summary | |
PersistenceManagerImpl()
|
Method Summary | |
void |
addInstanceLifecycleListener(InstanceLifecycleListener listener,
Class[] classes)
JDO 2.0 Preview. |
void |
afterCompletion(int status)
|
void |
assertActiveTransaction()
Throw an exception if there is no active transaction. |
protected kodo.runtime.StateManagerImpl |
assertManaged(Object pc)
Throw an exception if the given object is not managed; otherwise return its state manager. |
void |
assertNontransactionalRead()
Throw an exception if there is no transaction active and nontransactional reading is not enabled. |
void |
assertOpen()
Throw an exception if this persistence manager has been closed. |
Object |
attach(Object pc)
JDO 2.0 Preview. |
Collection |
attachAll(Collection pcs)
JDO 2.0 Preview. |
Object[] |
attachAll(Object[] pcs)
JDO 2.0 Preview. |
void |
beforeCompletion()
|
void |
begin()
|
boolean |
cancelAll()
Cancel all pending data store statements. |
void |
checkConsistency()
JDO 2.0 Preview. |
void |
close()
|
void |
commit()
|
void |
commitAndResume()
Issue a commit and then start a new transaction. |
Interaction |
createInteraction()
|
Transaction |
currentTransaction()
|
void |
deletePersistent(Object pc)
|
void |
deletePersistentAll(Collection pcs)
|
void |
deletePersistentAll(Object[] pcs)
|
Object |
detach(Object pc)
JDO 2.0 Preview. |
Collection |
detachAll(Collection pcs)
JDO 2.0 Preview. |
Object[] |
detachAll(Object[] pcs)
JDO 2.0 Preview. |
protected void |
endTransaction(int status)
End the current transaction, making appropriate state transitions. |
void |
evict(Object pc)
|
void |
evictAll()
|
void |
evictAll(Class cls)
Evict all persistent-clean and persistent-nontransactional instances in the extent of the given class (including subclasses). |
void |
evictAll(Collection pcs)
|
void |
evictAll(Extent extent)
Evict all persistent-clean and persistent-nontransactional instances in the given Extent . |
void |
evictAll(Object[] pcs)
|
protected void |
finalize()
Close on finalize. |
void |
flush()
JDO 2.0 Preview. |
protected void |
flush(int reason)
Flush the transactional state to the data store. |
protected void |
free()
Free the resources used by this persistence manager. |
Object |
getCachedObjectById(Object oid)
Return the cached instance for the given oid/object, or null if not cached. |
ClassLoader |
getClassLoader()
Return the current thread's class loader at the time this persistence manager was obtained from the persistence manager factory. |
boolean |
getCloseOnManagedCommit()
Whether to really close in a managed environment if the close method has been called and the transaction subsequently ends. |
JDOConfiguration |
getConfiguration()
Return the configuration associated with this persistence manager. |
Object |
getConnection()
Return the connection in use by the persistence manager, or a new connection if none. |
String |
getConnectionPassword()
Return the connection password. |
int |
getConnectionRetainMode()
Return the connection retain mode for this persistence manager. |
String |
getConnectionUserName()
Return the connection user name. |
int |
getDetachFields()
Detach mode constant to determine which fields are part of the detached graph. |
boolean |
getDetachOnClose()
Whether to detach all persistent managed objects when the persistence manager closes. |
Collection |
getDirtyClasses()
Return the set of classes that have been made dirty in the current transaction. |
boolean |
getEvictFromDataCache()
Whether to also evict an object from the data cache when it is evicted through the persistence manager. |
Extent |
getExtent(Class type,
boolean subclasses)
|
FetchConfiguration |
getFetchConfiguration()
Return the (mutable) fetch configuration for loading objects from this persistence manager. |
boolean |
getIgnoreCache()
|
InverseManager |
getInverseManager()
Return the inverse manager in use. |
LocalTransaction |
getLocalTransaction()
|
LockManager |
getLockManager()
Return the lock manager in use. |
Log |
getLog()
|
Collection |
getManagedObjects()
Return a list of all managed instances. |
ManagedRuntime |
getManagedRuntime()
Return the managed runtime in use. |
protected Collection |
getManagedStates()
|
ConnectionMetaData |
getMetaData()
|
boolean |
getMultithreaded()
|
boolean |
getNontransactionalRead()
|
boolean |
getNontransactionalWrite()
|
Object |
getObjectById(Class cls,
Object val)
JDO 2.0 Preview. |
Object |
getObjectById(Object oid,
boolean validate)
|
Object |
getObjectById(Object oid,
FetchConfiguration fetch,
BitSet exclude,
Object context,
int flags)
Return the object with the given oid. |
Object |
getObjectId(Object pc)
|
Class |
getObjectIdClass(Class cls)
|
int |
getObjectLookupMode()
Whether to return hollow objects from PersistenceManager.getObjectById(java.lang.Object, boolean) when the validate parameter
is false. |
Object[] |
getObjectsById(Object[] oids,
boolean validate)
JDO 2.0 Preview. |
Object[] |
getObjectsById(Object[] oids,
FetchConfiguration fetch,
BitSet exclude,
Object context,
int flags)
Return the objects with the given oids. |
boolean |
getOptimistic()
|
PersistenceManager |
getPersistenceManager()
|
PersistenceManagerFactory |
getPersistenceManagerFactory()
|
com.solarmetric.profile.ProfilingAgent |
getProfilingAgent()
|
boolean |
getRestoreValues()
|
ResultSetInfo |
getResultSetInfo()
|
boolean |
getRetainValues()
|
boolean |
getRetainValuesInOptimistic()
Per-persistence manager configuration of whether to retain values when entering an optimistic transaction. |
boolean |
getRollbackOnly()
JDO 2.0 Preview. |
KodoStateManager |
getState(Object oid)
Return the state manager for the instance with the given oid. |
KodoStateManager |
getStateManager(Object pc)
Return the state manager for the given instance. |
protected kodo.runtime.StateManagerImpl |
getStateManager(Object pc,
Object oid,
boolean allowNew)
Return the StateManager for the given instance or oid. |
StoreManager |
getStoreManager(boolean unwrap)
Return the store manager in use. |
Synchronization |
getSynchronization()
|
Object |
getTransactionalObjectId(Object pc)
|
Collection |
getTransactionalObjects()
Return a list of current transaction instances. |
protected Collection |
getTransactionalStates()
Return a copy of all transactional state managers. |
Object |
getUserObject()
|
Object |
getUserObject(Object key)
JDO 2.0 Preview. |
void |
initialize(PersistenceManagerFactoryImpl factory,
StoreManager sm,
String user,
String pass,
boolean managed,
int connMode)
Initialize the persistence manager. |
boolean |
isActive()
|
boolean |
isClosed()
|
boolean |
isManaged()
Whether this persistence manager is using managed transactions. |
void |
lock()
Synchronizes on an internal lock if the Multithreaded flag is set to true. |
void |
lockPersistent(Object pc)
Ensure that the given instance is locked at the current lock level, as set in the FetchConfiguration for the persistence manager. |
void |
lockPersistent(Object pc,
int level,
int timeout)
Ensure that the given instance is locked at the given lock level. |
void |
lockPersistentAll(Collection pcs)
Ensure that the given instances are locked at the current lock level, as set in the FetchConfiguration for the persistence manager. |
void |
lockPersistentAll(Collection pcs,
int level,
int timeout)
Ensure that the given instances are locked at the given lock level. |
void |
lockPersistentAll(Object[] pcs)
Ensure that the given instances are locked at the current lock level, as set in the FetchConfiguration for the persistence manager. |
void |
lockPersistentAll(Object[] pcs,
int level,
int timeout)
Ensure that the given instances are locked at the given lock level. |
void |
makeClassDirty(Class cls)
Mark the given class as dirty within the current transaction. |
KodoStateManager |
makeEmbedded(Object pc,
Object id,
KodoStateManager owner,
int ownerField)
Make the given instance embedded. |
void |
makeNontransactional(Object pc)
|
void |
makeNontransactionalAll(Collection pcs)
|
void |
makeNontransactionalAll(Object[] pcs)
|
void |
makePersistent(Object pc)
|
KodoStateManager |
makePersistent(Object pc,
Object id)
Make the given instance persistent. |
void |
makePersistentAll(Collection pcs)
|
void |
makePersistentAll(Object[] pcs)
|
void |
makeTransactional(Object pc)
|
void |
makeTransactionalAll(Collection pcs)
|
void |
makeTransactionalAll(Object[] pcs)
|
void |
makeTransient(Object pc)
|
void |
makeTransientAll(Collection pcs)
|
void |
makeTransientAll(Object[] pcs)
|
protected Map |
newManagedObjectCache()
Create a Map to be used for the managed object cache. |
Query |
newNamedQuery(Class cls,
String name)
JDO 2.0 Preview. |
Object |
newObjectIdInstance(Class cls,
Object val)
JDO 2.0 Preview. |
protected Object |
newObjectIdInstance(Class cls,
Object val,
boolean requireMetaData)
Create a new object id instance from the given value. |
Object |
newObjectIdInstance(Class cls,
String str)
|
Query |
newQuery()
|
Query |
newQuery(Class cls)
|
Query |
newQuery(Class cls,
Collection cln)
|
Query |
newQuery(Class cls,
Collection cln,
String filter)
|
Query |
newQuery(Class cls,
String filter)
|
Query |
newQuery(Extent ext)
|
Query |
newQuery(Extent ext,
String filter)
|
Query |
newQuery(Object compiled)
|
Query |
newQuery(String language,
Object compiled)
|
KodoStateManager |
newStateManager(Object oid,
boolean copyOids)
Create a new state manager with the given oid and corresponding metadata. |
void |
preFlush()
Run pre-flush actions on transactional objects, including persistence-by-reachability, inverse relationship management, deletion of dependent instances, and instance callbacks. |
Object |
putUserObject(Object key,
Object val)
JDO 2.0 Preview. |
void |
refresh(Object pc)
|
void |
refreshAll()
|
void |
refreshAll(Collection pcs)
|
void |
refreshAll(JDOException jdoe)
JDO 2.0 Preview. |
void |
refreshAll(Object[] pcs)
|
void |
registerListener(TransactionListener tl)
Register a listener for transaction-related events. |
void |
removeInstanceLifecycleListener(InstanceLifecycleListener listener)
JDO 2.0 Preview. |
boolean |
removeListener(TransactionListener tl)
Remove a listener for transaction-related events. |
Object |
removeUserObject(Object key)
JDO 2.0 Preview. |
void |
retrieve(Object pc)
|
void |
retrieve(Object pc,
boolean dfgOnly)
Immediately load the given object's persistent fields. |
void |
retrieveAll(Collection pcs)
|
void |
retrieveAll(Collection pcs,
boolean dfgOnly)
|
void |
retrieveAll(Object[] pcs)
|
void |
retrieveAll(Object[] pcs,
boolean dfgOnly)
|
void |
rollback()
|
void |
rollbackAndResume()
Issue a rollback and then start a new transaction. |
void |
setCloseOnManagedCommit(boolean close)
Whether to really close in a managed environment if the close method has been called and the transaction subsequently ends. |
void |
setDetachFields(int mode)
Detach mode constant to determine which fields are part of the detached graph. |
void |
setDetachFields(String mode)
For string-based auto-configuration of detach fields mode. |
void |
setDetachOnClose(boolean detach)
Whether to detach all persistent managed objects when the persistence manager closes. |
void |
setEvictFromDataCache(boolean evict)
Whether to also evict an object from the data cache when it is evicted through the persistence manager. |
void |
setIgnoreCache(boolean val)
|
void |
setMultithreaded(boolean multithreaded)
|
void |
setNontransactionalRead(boolean val)
|
void |
setNontransactionalWrite(boolean val)
|
void |
setObjectLookupMode(int mode)
Whether to return hollow objects from PersistenceManager.getObjectById(java.lang.Object, boolean) when the validate parameter
is false. |
void |
setOptimistic(boolean val)
|
void |
setRestoreValues(boolean val)
|
void |
setRetainValues(boolean val)
|
void |
setRetainValuesInOptimistic(boolean val)
Per-persistence manager configuration of whether to retain values when entering an optimistic transaction. |
void |
setRollbackOnly()
JDO 2.0 Preview. |
void |
setSynchronization(Synchronization synch)
|
void |
setUserObject(Object o)
|
void |
unlock()
Releases the internal lock. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int FLUSH_INC
protected static final int FLUSH_COMMIT
protected static final int FLUSH_ROLLBACK
protected static final int FLUSH_LOGICAL
Constructor Detail |
public PersistenceManagerImpl()
Method Detail |
public void initialize(PersistenceManagerFactoryImpl factory, StoreManager sm, String user, String pass, boolean managed, int connMode)
factory
- the PersistenceManagerFactory used to create
this PersistenceManagersm
- a concrete StoreManager implementation to
handle interaction with the data storeuser
- the username this PersistenceManager represents;
used when pooling managers to make sure that
a request to the PersistenceManagerFactory for
a connection with an explicit user is
delegated to a suitable PersistenceManagerpass
- the password for the above usermanaged
- the transaction modeconnMode
- the connection retain modeprotected void finalize() throws Throwable
finalize
in class Object
protected Map newManagedObjectCache()
Map
to be used for the managed object cache. Maps
oids to state managers. By default, this creates a
ReferenceMap
with soft values.public boolean getCloseOnManagedCommit()
public void setCloseOnManagedCommit(boolean close)
public boolean getEvictFromDataCache()
public void setEvictFromDataCache(boolean evict)
public ConnectionMetaData getMetaData()
getMetaData
in interface Connection
public Interaction createInteraction() throws NotSupportedException
createInteraction
in interface Connection
public LocalTransaction getLocalTransaction() throws NotSupportedException
getLocalTransaction
in interface Connection
public ResultSetInfo getResultSetInfo() throws NotSupportedException
getResultSetInfo
in interface Connection
public PersistenceManager getPersistenceManager()
getPersistenceManager
in interface Transaction
public boolean getNontransactionalRead()
getNontransactionalRead
in interface Transaction
public void setNontransactionalRead(boolean val)
setNontransactionalRead
in interface Transaction
public boolean getNontransactionalWrite()
getNontransactionalWrite
in interface Transaction
public void setNontransactionalWrite(boolean val)
setNontransactionalWrite
in interface Transaction
public boolean getOptimistic()
getOptimistic
in interface Transaction
public void setOptimistic(boolean val)
setOptimistic
in interface Transaction
public boolean getRetainValues()
getRetainValues
in interface Transaction
public void setRetainValues(boolean val)
setRetainValues
in interface Transaction
public boolean getRetainValuesInOptimistic()
KodoPersistenceManager
getRetainValuesInOptimistic
in interface KodoPersistenceManager
public void setRetainValuesInOptimistic(boolean val)
KodoPersistenceManager
setRetainValuesInOptimistic
in interface KodoPersistenceManager
public int getObjectLookupMode()
KodoPersistenceManager
PersistenceManager.getObjectById(java.lang.Object, boolean)
when the validate parameter
is false.getObjectLookupMode
in interface KodoPersistenceManager
public void setObjectLookupMode(int mode)
KodoPersistenceManager
PersistenceManager.getObjectById(java.lang.Object, boolean)
when the validate parameter
is false.setObjectLookupMode
in interface KodoPersistenceManager
public boolean getRestoreValues()
getRestoreValues
in interface Transaction
public void setRestoreValues(boolean val)
setRestoreValues
in interface Transaction
public boolean getIgnoreCache()
getIgnoreCache
in interface PersistenceManager
public void setIgnoreCache(boolean val)
setIgnoreCache
in interface PersistenceManager
public void begin()
begin
in interface Transaction
public void commit()
commit
in interface Transaction
public void rollback()
rollback
in interface Transaction
public boolean getRollbackOnly()
KodoPersistenceManager
Transaction
.getRollbackOnly
in interface KodoPersistenceManager
public void setRollbackOnly()
KodoPersistenceManager
Transaction
.setRollbackOnly
in interface KodoPersistenceManager
public void flush()
KodoPersistenceManager
JDOFatalException
.flush
in interface KodoPersistenceManager
public void checkConsistency()
KodoPersistenceManager
KodoPersistenceManager.flush()
. In an
optimistic transaction that has not yet begun a datastore-level
transaction, however, it will only report exceptions that would occur
on flush, without retaining any datastore resources.checkConsistency
in interface KodoPersistenceManager
public void preFlush()
KodoPersistenceManager
preFlush
in interface KodoPersistenceManager
public void commitAndResume()
KodoPersistenceManager
pm.currentTransaction ().commit (); pm.currentTransaction ().begin ();except that the PersistenceManager's internal atomic lock is utilized, so this method can be safely executed from multiple threads.
commitAndResume
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
Transaction.commit()
,
Transaction.begin()
public void rollbackAndResume()
KodoPersistenceManager
pm.currentTransaction ().rollback (); pm.currentTransaction ().begin ();except that the PersistenceManager's internal atomic lock is utilized, so this method can be safely executed from multiple threads.
rollbackAndResume
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
Transaction.rollback()
,
Transaction.begin()
public Synchronization getSynchronization()
getSynchronization
in interface Transaction
public void setSynchronization(Synchronization synch)
setSynchronization
in interface Transaction
public boolean isActive()
isActive
in interface Transaction
public void beforeCompletion()
beforeCompletion
in interface Synchronization
public void afterCompletion(int status)
afterCompletion
in interface Synchronization
protected void flush(int reason)
reason
- one of FLUSH_INC
, FLUSH_COMMIT
,
FLUSH_ROLLBACK
, or FLUSH_LOGICAL
protected void endTransaction(int status)
public JDOConfiguration getConfiguration()
KodoPersistenceManager
getConfiguration
in interface KodoPersistenceManager
public Log getLog()
public FetchConfiguration getFetchConfiguration()
KodoPersistenceManager
getFetchConfiguration
in interface KodoPersistenceManager
public int getConnectionRetainMode()
KodoPersistenceManager
getConnectionRetainMode
in interface KodoPersistenceManager
public Object getConnection()
KodoPersistenceManager
pm.currentTransaction().getOptimistic() == false
).
When finished with this connection, you should close it as appropriate.getConnection
in interface KodoPersistenceManager
public boolean isManaged()
KodoPersistenceManager
isManaged
in interface KodoPersistenceManager
public ManagedRuntime getManagedRuntime()
KodoPersistenceManager
getManagedRuntime
in interface KodoPersistenceManager
public ClassLoader getClassLoader()
KodoPersistenceManager
getClassLoader
in interface KodoPersistenceManager
public String getConnectionUserName()
KodoPersistenceManager
getConnectionUserName
in interface KodoPersistenceManager
public String getConnectionPassword()
KodoPersistenceManager
getConnectionPassword
in interface KodoPersistenceManager
public com.solarmetric.profile.ProfilingAgent getProfilingAgent()
getProfilingAgent
in interface com.solarmetric.profile.ProfilingAgentProvider
public void makeClassDirty(Class cls)
KodoPersistenceManager
makeClassDirty
in interface KodoPersistenceManager
public Collection getDirtyClasses()
KodoPersistenceManager
KodoPersistenceManager.makeClassDirty(java.lang.Class)
.getDirtyClasses
in interface KodoPersistenceManager
public Object putUserObject(Object key, Object val)
KodoPersistenceManager
putUserObject
in interface KodoPersistenceManager
public Object getUserObject(Object key)
KodoPersistenceManager
getUserObject
in interface KodoPersistenceManager
public Object removeUserObject(Object key)
KodoPersistenceManager
removeUserObject
in interface KodoPersistenceManager
public Object getUserObject()
getUserObject
in interface PersistenceManager
public void setUserObject(Object o)
setUserObject
in interface PersistenceManager
public PersistenceManagerFactory getPersistenceManagerFactory()
getPersistenceManagerFactory
in interface PersistenceManager
public boolean getMultithreaded()
getMultithreaded
in interface PersistenceManager
public void setMultithreaded(boolean multithreaded)
setMultithreaded
in interface PersistenceManager
public void registerListener(TransactionListener tl)
KodoPersistenceManager
registerListener
in interface KodoPersistenceManager
public boolean removeListener(TransactionListener tl)
KodoPersistenceManager
removeListener
in interface KodoPersistenceManager
public Transaction currentTransaction()
currentTransaction
in interface PersistenceManager
public boolean cancelAll()
KodoPersistenceManager
cancelAll
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
public boolean isClosed()
isClosed
in interface PersistenceManager
public void close()
close
in interface PersistenceManager
protected void free()
public Object getObjectId(Object pc)
getObjectId
in interface PersistenceManager
public Object getTransactionalObjectId(Object pc)
getTransactionalObjectId
in interface PersistenceManager
public Class getObjectIdClass(Class cls)
getObjectIdClass
in interface PersistenceManager
public Object newObjectIdInstance(Class cls, String str)
newObjectIdInstance
in interface PersistenceManager
public Object newObjectIdInstance(Class cls, Object val)
KodoPersistenceManager
newObjectIdInstance
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
cls
- the persitent class that uses this identity valueval
- an object id instance, stringified object id, or primary
key valueprotected Object newObjectIdInstance(Class cls, Object val, boolean requireMetaData)
public Object getObjectById(Object oid, boolean validate)
getObjectById
in interface PersistenceManager
public Object getObjectById(Object oid, FetchConfiguration fetch, BitSet exclude, Object context, int flags)
KodoPersistenceManagerSPI
exclude
mask.getObjectById
in interface KodoPersistenceManagerSPI
public KodoStateManager newStateManager(Object oid, boolean copyOids)
newStateManager
in interface KodoPersistenceManagerSPI
public Object[] getObjectsById(Object[] oids, boolean validate)
KodoPersistenceManager
getObjectsById
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
oids
- the oids of the objects to returnvalidate
- if true, the existance of the objects in
the datastore will be validated.PersistenceManager.getObjectById(Object,boolean)
public Object[] getObjectsById(Object[] oids, FetchConfiguration fetch, BitSet exclude, Object context, int flags)
KodoPersistenceManagerSPI
getObjectsById
in interface KodoPersistenceManagerSPI
public Object getObjectById(Class cls, Object val)
KodoPersistenceManager
getObjectById
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
cls
- the class of the matching objectval
- either an oid instance, the string version of the oid, or
the primary key valuepublic Object getCachedObjectById(Object oid)
KodoPersistenceManager
getCachedObjectById
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
oid
- the object's idpublic void makePersistentAll(Collection pcs)
makePersistentAll
in interface PersistenceManager
public void makePersistentAll(Object[] pcs)
makePersistentAll
in interface PersistenceManager
public void makePersistent(Object pc)
makePersistent
in interface PersistenceManager
public KodoStateManager makePersistent(Object pc, Object id)
KodoPersistenceManagerSPI
makePersistent
in interface KodoPersistenceManagerSPI
kodo.runtime.KodoPersistenceManagerSPI
pc
- the instance to persistid
- the id to give the state manager; may be null for defaultpublic void deletePersistentAll(Collection pcs)
deletePersistentAll
in interface PersistenceManager
public void deletePersistentAll(Object[] pcs)
deletePersistentAll
in interface PersistenceManager
public void deletePersistent(Object pc)
deletePersistent
in interface PersistenceManager
public void makeNontransactionalAll(Collection pcs)
makeNontransactionalAll
in interface PersistenceManager
public void makeNontransactionalAll(Object[] pcs)
makeNontransactionalAll
in interface PersistenceManager
public void makeNontransactional(Object pc)
makeNontransactional
in interface PersistenceManager
public void makeTransactionalAll(Collection pcs)
makeTransactionalAll
in interface PersistenceManager
public void makeTransactionalAll(Object[] pcs)
makeTransactionalAll
in interface PersistenceManager
public void makeTransactional(Object pc)
makeTransactional
in interface PersistenceManager
public void makeTransientAll(Collection pcs)
makeTransientAll
in interface PersistenceManager
public void makeTransientAll(Object[] pcs)
makeTransientAll
in interface PersistenceManager
public void makeTransient(Object pc)
makeTransient
in interface PersistenceManager
public KodoStateManager makeEmbedded(Object pc, Object id, KodoStateManager owner, int ownerField)
KodoPersistenceManagerSPI
makeEmbedded
in interface KodoPersistenceManagerSPI
kodo.runtime.KodoPersistenceManagerSPI
pc
- the instance to embed, or null to embed a
newly-created instance that will be loaded with
datastore dataid
- the id to give the embedded state manager; may be
null for defaultowner
- the owning state managerownerField
- the field number of the owning objectpublic void refreshAll()
refreshAll
in interface PersistenceManager
public void refreshAll(Collection pcs)
refreshAll
in interface PersistenceManager
public void refreshAll(Object[] pcs)
refreshAll
in interface PersistenceManager
public void refreshAll(JDOException jdoe)
KodoPersistenceManager
JDOException
or nested exceptions.refreshAll
in interface KodoPersistenceManager
public void refresh(Object pc)
refresh
in interface PersistenceManager
public void retrieveAll(Collection pcs)
retrieveAll
in interface PersistenceManager
public void retrieveAll(Collection pcs, boolean dfgOnly)
retrieveAll
in interface PersistenceManager
public void retrieveAll(Object[] pcs)
retrieveAll
in interface PersistenceManager
public void retrieveAll(Object[] pcs, boolean dfgOnly)
retrieveAll
in interface PersistenceManager
public void retrieve(Object pc)
retrieve
in interface PersistenceManager
public void retrieve(Object pc, boolean dfgOnly)
KodoPersistenceManager
retrieve
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
pc
- the instance whose fields should be retrieveddfgOnly
- indicator as to whether to retrieve only fields
in the current fetch groups, or all fieldsPersistenceManager.retrieveAll(Collection,boolean)
public void evictAll()
evictAll
in interface PersistenceManager
public void evictAll(Collection pcs)
evictAll
in interface PersistenceManager
public void evictAll(Object[] pcs)
evictAll
in interface PersistenceManager
public void evictAll(Class cls)
KodoPersistenceManager
evictAll
in interface KodoPersistenceManager
public void evictAll(Extent extent)
KodoPersistenceManager
Extent
.evictAll
in interface KodoPersistenceManager
public void evict(Object pc)
evict
in interface PersistenceManager
public void lockPersistent(Object pc)
KodoPersistenceManager
FetchConfiguration
for the persistence manager.lockPersistent
in interface KodoPersistenceManager
public void lockPersistent(Object pc, int level, int timeout)
KodoPersistenceManager
lockPersistent
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
pc
- the object to locklevel
- the lock level to usetimeout
- the number of milliseconds to wait for the lock before
giving up, or -1 for no limitpublic void lockPersistentAll(Collection pcs)
KodoPersistenceManager
FetchConfiguration
for the persistence manager.lockPersistentAll
in interface KodoPersistenceManager
public void lockPersistentAll(Collection pcs, int level, int timeout)
KodoPersistenceManager
lockPersistentAll
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
pcs
- the objects to locklevel
- the lock level to usetimeout
- the number of milliseconds to wait for the lock before
giving up, or -1 for no limitpublic void lockPersistentAll(Object[] pcs)
KodoPersistenceManager
FetchConfiguration
for the persistence manager.lockPersistentAll
in interface KodoPersistenceManager
public void lockPersistentAll(Object[] pcs, int level, int timeout)
KodoPersistenceManager
lockPersistentAll
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
pcs
- the objects to locklevel
- the lock level to usetimeout
- the number of milliseconds to wait for the lock before
giving up, or -1 for no limitpublic Extent getExtent(Class type, boolean subclasses)
getExtent
in interface PersistenceManager
public Query newQuery()
newQuery
in interface PersistenceManager
public Query newQuery(Class cls)
newQuery
in interface PersistenceManager
public Query newQuery(Class cls, Collection cln)
newQuery
in interface PersistenceManager
public Query newQuery(Extent ext)
newQuery
in interface PersistenceManager
public Query newQuery(Class cls, Collection cln, String filter)
newQuery
in interface PersistenceManager
public Query newQuery(Extent ext, String filter)
newQuery
in interface PersistenceManager
public Query newQuery(Class cls, String filter)
newQuery
in interface PersistenceManager
public Query newQuery(Object compiled)
newQuery
in interface PersistenceManager
public Query newQuery(String language, Object compiled)
newQuery
in interface PersistenceManager
public Query newNamedQuery(Class cls, String name)
KodoPersistenceManager
newNamedQuery
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
cls
- if not null, the candidate class to queryname
- the name of the query to lookupQuery
instance based on the information
defined in the metadatapublic void lock()
KodoPersistenceManagerSPI
Multithreaded
flag is set to true. Make sure to call
KodoPersistenceManagerSPI.unlock()
in a finally clause of the same method.lock
in interface KodoPersistenceManagerSPI
public void unlock()
KodoPersistenceManagerSPI
unlock
in interface KodoPersistenceManagerSPI
public StoreManager getStoreManager(boolean unwrap)
KodoPersistenceManagerSPI
getStoreManager
in interface KodoPersistenceManagerSPI
kodo.runtime.KodoPersistenceManagerSPI
unwrap
- if true, the native store manager will be returned;
otherwise, the store manager used by this
persistence manager, which may be a decorator
around the native store manager, will be returnedpublic LockManager getLockManager()
KodoPersistenceManagerSPI
getLockManager
in interface KodoPersistenceManagerSPI
public InverseManager getInverseManager()
KodoPersistenceManagerSPI
getInverseManager
in interface KodoPersistenceManagerSPI
public KodoStateManager getState(Object oid)
KodoPersistenceManager
getState
in interface KodoPersistenceManager
public KodoStateManager getStateManager(Object pc)
KodoPersistenceManagerSPI
getStateManager
in interface KodoPersistenceManagerSPI
protected kodo.runtime.StateManagerImpl getStateManager(Object pc, Object oid, boolean allowNew)
allowNew
- if true, objects made persistent in the current
transaction will be included in the search;
if multiple new objects match the given oid, it
is undetermined which will be returnedpublic Collection getManagedObjects()
KodoPersistenceManager
getManagedObjects
in interface KodoPersistenceManager
public Collection getTransactionalObjects()
KodoPersistenceManager
getTransactionalObjects
in interface KodoPersistenceManager
protected Collection getManagedStates()
protected Collection getTransactionalStates()
public void addInstanceLifecycleListener(InstanceLifecycleListener listener, Class[] classes)
KodoPersistenceManager
addInstanceLifecycleListener
in interface KodoPersistenceManager
public void removeInstanceLifecycleListener(InstanceLifecycleListener listener)
KodoPersistenceManager
removeInstanceLifecycleListener
in interface KodoPersistenceManager
public boolean getDetachOnClose()
KodoPersistenceManager
getDetachOnClose
in interface KodoPersistenceManager
public void setDetachOnClose(boolean detach)
KodoPersistenceManager
setDetachOnClose
in interface KodoPersistenceManager
public void setDetachFields(String mode)
public int getDetachFields()
KodoPersistenceManager
KodoPersistenceManager.DETACH_FGS
.getDetachFields
in interface KodoPersistenceManager
public void setDetachFields(int mode)
KodoPersistenceManager
KodoPersistenceManager.DETACH_FGS
.setDetachFields
in interface KodoPersistenceManager
public Object detach(Object pc)
KodoPersistenceManager
detach
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
pc
- the instance to detachKodoPersistenceManager.detachAll(Object[])
public Object[] detachAll(Object[] pcs)
KodoPersistenceManager
KodoPersistenceManager.attachAll(Object[])
. The detached
instances will be unmanaged copies of the specified parameters,
and are suitable for serialization and manipulation outside
of a Kodo environment. When detaching instances, only fields
in the current FetchConfiguration
will be traversed. Thus,
to detach a graph of objects, relations to other persistent
instances must either be in the default-fetch-group
,
or in the current custom FetchConfiguration
.detachAll
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
pcs
- the instances to detachJDOUserException
- if any of the instances do not
have the detachable
metadata extension.KodoPersistenceManager.attachAll(Object[])
,
KodoHelper.getDetachedObjectId(java.lang.Object)
,
KodoHelper.getDetachedState(java.lang.Object)
,
KodoPersistenceManager.getFetchConfiguration()
public Collection detachAll(Collection pcs)
KodoPersistenceManager
detachAll
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
pcs
- the instances to detachKodoPersistenceManager.detachAll(Object[])
public Object attach(Object pc)
KodoPersistenceManager
attach
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
pc
- instance to importKodoPersistenceManager.attachAll(Object[])
public Object[] attachAll(Object[] pcs)
KodoPersistenceManager
attachAll
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
pcs
- array of instances to importJDOUserException
- if any of the instances are not detachable,
or if there is not a current active transaction.JDOOptimisticVerificationException
- when attempting to
attaching instance that has been deleted in
the data store, or when attaching an instance into
a PersistenceManager that currently has cached
an earlier version of that instance.KodoPersistenceManager.detachAll(Object[])
public Collection attachAll(Collection pcs)
KodoPersistenceManager
attachAll
in interface KodoPersistenceManager
kodo.runtime.KodoPersistenceManager
pcs
- Collection of instances to importKodoPersistenceManager.attachAll(Object[])
public void assertOpen()
KodoPersistenceManagerSPI
assertOpen
in interface KodoPersistenceManagerSPI
public void assertActiveTransaction()
KodoPersistenceManagerSPI
assertActiveTransaction
in interface KodoPersistenceManagerSPI
public void assertNontransactionalRead()
KodoPersistenceManagerSPI
assertNontransactionalRead
in interface KodoPersistenceManagerSPI
protected kodo.runtime.StateManagerImpl assertManaged(Object pc)
|
SolarMetric Kodo JDO 3.3.5 generated on August 31 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |