Package org.datanucleus.jdo.connector
Class PersistenceManagerImpl
- java.lang.Object
-
- org.datanucleus.jdo.connector.PersistenceManagerImpl
-
- All Implemented Interfaces:
AutoCloseable,javax.jdo.PersistenceManager,javax.resource.cci.Connection
public class PersistenceManagerImpl extends Object implements javax.resource.cci.Connection, javax.jdo.PersistenceManager
Implementation of the PersistenceManager for use in JCA environments. An application handle associated with theManagedConnectionImpl.
-
-
Field Summary
Fields Modifier and Type Field Description static org.datanucleus.util.NucleusLoggerLOGGERLogger for JCA.
-
Constructor Summary
Constructors Constructor Description PersistenceManagerImpl(ManagedConnectionImpl mc)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener, Class... classes)JDO 2.0 spec 12.15 "LifecycleListeners".voidcheckConsistency()Method to check the consistency of the cache.voidclose()Method to close the Persistence Manager.javax.resource.cci.InteractioncreateInteraction()javax.jdo.TransactioncurrentTransaction()Accessor for the current transactionvoiddeletePersistent(Object pc)JDO method to delete a Persistence Capable objectvoiddeletePersistentAll(Object... pcs)JDO method to delete an array of Persistence Capable objectsvoiddeletePersistentAll(Collection pcs)JDO method to delete a Collection of Persistence Capable objectsObjectdetachCopy(Object pc)Detach the specified object from thePersistenceManager.Object[]detachCopyAll(Object... pcs)Detach the specified objects from thePersistenceManager.CollectiondetachCopyAll(Collection pcs)Detach the specified objects from thePersistenceManager.voidevict(Object o)Method to evict an objectvoidevictAll()Method to evict all objects from the PM.voidevictAll(boolean subclasses, Class cls)Method to evict all objects of the specified type (and optionally its subclasses).voidevictAll(Class cls, boolean subclasses)Method to evict all objects of the specified type (and optionally its subclasses).voidevictAll(Object... os)Method to evict an array of objectsvoidevictAll(Collection os)Method to evict all of the specified objects from the PM.voidflush()This method flushes all dirty, new, and deleted instances to the datastore.booleangetCopyOnAttach()javax.jdo.datastore.JDOConnectiongetDataStoreConnection()(non-Javadoc)IntegergetDatastoreReadTimeoutMillis()IntegergetDatastoreWriteTimeoutMillis()booleangetDetachAllOnCommit()Accessor for whether to detach objects on commit of the txn.javax.jdo.ExtentgetExtent(Class cls)Accessor for the extent of a candidate class.javax.jdo.ExtentgetExtent(Class cls, boolean subclasses)Accessor for the extent of a candidate class.javax.jdo.FetchGroupgetFetchGroup(Class cls, String name)javax.jdo.FetchPlangetFetchPlan()Accessor for the current FetchPlanbooleangetIgnoreCache()Accessor for whether to ignore the cache or notorg.datanucleus.api.jdo.JDOPersistenceManagergetJDOPersistenceManager()javax.resource.cci.LocalTransactiongetLocalTransaction()SetgetManagedObjects()SetgetManagedObjects(Class... classes)SetgetManagedObjects(EnumSet states)SetgetManagedObjects(EnumSet states, Class... classes)javax.resource.cci.ConnectionMetaDatagetMetaData()booleangetMultithreaded()Accessor for the multithreaded capability of the managerObjectgetObjectById(Class cls, Object key)ObjectgetObjectById(Object id)Accessor for an object given its id.ObjectgetObjectById(Object id, boolean validate)Accessor for an object given its id.ObjectgetObjectId(Object pc)Accessor for the id of an object.ClassgetObjectIdClass(Class clazz)Retrieve the class for the objectidObject[]getObjectsById(boolean validate, Object... oids)Object[]getObjectsById(Object... oids)Object[]getObjectsById(Object[] oids, boolean validate)CollectiongetObjectsById(Collection oids)CollectiongetObjectsById(Collection oids, boolean validate)javax.jdo.PersistenceManagerFactorygetPersistenceManagerFactory()Retrieve the PersistenceManagerFactory for this managerMap<String,Object>getProperties()javax.resource.cci.ResultSetInfogetResultSetInfo()javax.jdo.datastore.SequencegetSequence(String sequenceName)Accessor for a Sequence.DategetServerDate()Accessor for the server date/time.Set<String>getSupportedProperties()ObjectgetTransactionalObjectId(Object pc)ObjectgetUserObject()The application might manage PersistenceManager instances by using an associated object for bookkeeping purposes.ObjectgetUserObject(Object key)Method to get a user object from the PersistenceManager.booleanisClosed()Accessor for whether the Persistence Manager is closed.voidmakeNontransactional(Object pc)Make a Persistence-Capable object non-transactionalvoidmakeNontransactionalAll(Object... pcs)Make an array of Persistence-Capable objects non-transactionalvoidmakeNontransactionalAll(Collection pcs)Make a Collection of Persistence-Capable objects non-transactionalObjectmakePersistent(Object pc)Method to make an object persistent.Object[]makePersistentAll(Object... pcs)Make an array of Persistent Capable objects persistentCollectionmakePersistentAll(Collection pcs)Make a Collection of Persistence Capable objects persistentvoidmakeTransactional(Object pc)Make a Persistence-Capable object transientvoidmakeTransactionalAll(Object... pcs)Make an array of Persistence-Capable objects transactionalvoidmakeTransactionalAll(Collection pcs)Make a collection of persistable objects transactionalvoidmakeTransient(Object pc)Make a Persistence-Capable object transientvoidmakeTransient(Object pc, boolean useFetchPlan)Make a Persistence-Capable object transient , optionally using the fetch plan.voidmakeTransientAll(boolean useFetchPlan, Object... pcs)Make an array of Persistence-Capable objects transientvoidmakeTransientAll(Object... pcs)Make an array of Persistence-Capable objects transientvoidmakeTransientAll(Object[] pcs, boolean useFetchPlan)Make an array of Persistence-Capable objects transientvoidmakeTransientAll(Collection pcs)Make a Collection of Persistence-Capable objects transientvoidmakeTransientAll(Collection pcs, boolean useFetchPlan)Make a Collection of Persistence-Capable objects transientObjectnewInstance(Class pc)Method to create an instance of an interface or abstract class<T> javax.jdo.JDOQLTypedQuery<T>newJDOQLTypedQuery(Class<T> cls)javax.jdo.QuerynewNamedQuery(Class cls, String queryName)Accessor for a new named query.ObjectnewObjectIdInstance(Class pcClass, Object key)ObjectnewObjectIdInstance(Class clazz, String str)javax.jdo.QuerynewQuery()Accessor for a new query.javax.jdo.QuerynewQuery(Class cls)Accessor for a new query using this candidate class.javax.jdo.QuerynewQuery(Class cls, String filter)Accessor for a new query.javax.jdo.QuerynewQuery(Class cls, Collection cln)Accessor for a new query.javax.jdo.QuerynewQuery(Class cls, Collection cln, String filter)Accessor for a new query.javax.jdo.QuerynewQuery(Object obj)Accessor for a new query.javax.jdo.QuerynewQuery(String query)Accessor for a single-string query.javax.jdo.QuerynewQuery(String language, Object query)Accessor for a new query in the specified query language etc.javax.jdo.QuerynewQuery(javax.jdo.Extent ext)Accessor for a new query based on the provided extent.javax.jdo.QuerynewQuery(javax.jdo.Extent cln, String filter)Accessor for a new query.ObjectputUserObject(Object key, Object value)Method to put a user object into the PersistenceManager.voidrefresh(Object o)Method to refresh an objectvoidrefreshAll()Method to refresh all objects in the Persistence Manager.voidrefreshAll(Object... os)Method to refresh an array of objects.voidrefreshAll(Collection os)Method to refresh a collection of objects.voidrefreshAll(javax.jdo.JDOException exc)Method to refresh objects that failed verification in a JDOExceptionvoidremoveInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener)JDO 2.0 spec 12.15 "LifecycleListeners".ObjectremoveUserObject(Object key)Method to remove a user object from the PersistenceManager.voidretrieve(Object o)Method to retrieve an objectvoidretrieve(Object o, boolean fgOnly)Method to retrieve an objectvoidretrieveAll(boolean fgOnly, Object... pcs)Retrieve field values of instances from the store.voidretrieveAll(Object... pcs)Retrieve an array of Persistence-Capable objectsvoidretrieveAll(Object[] pcs, boolean fgOnly)Retrieve field values of instances from the store.voidretrieveAll(Collection pcs)Retrieve a Collection of Persistence-Capable objectsvoidretrieveAll(Collection pcs, boolean fgOnly)Retrieve field values of instances from the store.voidsetCopyOnAttach(boolean flag)voidsetDatastoreReadTimeoutMillis(Integer intvl)voidsetDatastoreWriteTimeoutMillis(Integer intvl)voidsetDetachAllOnCommit(boolean detach)Mutator for whether to detach all objects on commit of the txn.voidsetIgnoreCache(boolean ignore)Mutator for whether to ignore the cache or notvoidsetMultithreaded(boolean multithreaded)Mutator for the multithreaded capability of the managervoidsetProperty(String propertyName, Object value)voidsetUserObject(Object obj)The application might manage PersistenceManager instances by using an associated object for bookkeeping purposes.
-
-
-
Constructor Detail
-
PersistenceManagerImpl
public PersistenceManagerImpl(ManagedConnectionImpl mc)
Constructor.- Parameters:
mc- The connection implementation.
-
-
Method Detail
-
getJDOPersistenceManager
public org.datanucleus.api.jdo.JDOPersistenceManager getJDOPersistenceManager()
-
getLocalTransaction
public javax.resource.cci.LocalTransaction getLocalTransaction() throws javax.resource.ResourceException- Specified by:
getLocalTransactionin interfacejavax.resource.cci.Connection- Throws:
javax.resource.ResourceException
-
getMetaData
public javax.resource.cci.ConnectionMetaData getMetaData() throws javax.resource.ResourceException- Specified by:
getMetaDatain interfacejavax.resource.cci.Connection- Throws:
javax.resource.ResourceException
-
createInteraction
public javax.resource.cci.Interaction createInteraction() throws javax.resource.ResourceException- Specified by:
createInteractionin interfacejavax.resource.cci.Connection- Throws:
javax.resource.ResourceException
-
getResultSetInfo
public javax.resource.cci.ResultSetInfo getResultSetInfo() throws javax.resource.ResourceException- Specified by:
getResultSetInfoin interfacejavax.resource.cci.Connection- Throws:
javax.resource.ResourceException
-
close
public void close()
Method to close the Persistence Manager. This is invoked by the application server if this handle is not closed- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacejavax.resource.cci.Connection- Specified by:
closein interfacejavax.jdo.PersistenceManager
-
isClosed
public boolean isClosed()
Accessor for whether the Persistence Manager is closed.- Specified by:
isClosedin interfacejavax.jdo.PersistenceManager- Returns:
- Whether the Persistence Manager is closed.
-
setDetachAllOnCommit
public void setDetachAllOnCommit(boolean detach)
Mutator for whether to detach all objects on commit of the txn.- Specified by:
setDetachAllOnCommitin interfacejavax.jdo.PersistenceManager- Parameters:
detach- Whether to detach objects on commit of the txn.
-
getDetachAllOnCommit
public boolean getDetachAllOnCommit()
Accessor for whether to detach objects on commit of the txn.- Specified by:
getDetachAllOnCommitin interfacejavax.jdo.PersistenceManager- Returns:
- Whether to detach objects on commit of the txn.
-
refresh
public void refresh(Object o)
Method to refresh an object- Specified by:
refreshin interfacejavax.jdo.PersistenceManager- Parameters:
o- Object to refresh
-
retrieve
public void retrieve(Object o, boolean fgOnly)
Method to retrieve an object- Specified by:
retrievein interfacejavax.jdo.PersistenceManager- Parameters:
o- Object to retrievefgOnly- Whether to include only fields in current fetch group
-
retrieve
public void retrieve(Object o)
Method to retrieve an object- Specified by:
retrievein interfacejavax.jdo.PersistenceManager- Parameters:
o- Object to retrieve
-
retrieveAll
public void retrieveAll(Collection pcs)
Retrieve a Collection of Persistence-Capable objects- Specified by:
retrieveAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- Collection of Persistence-Capable objects
-
retrieveAll
public void retrieveAll(Object... pcs)
Retrieve an array of Persistence-Capable objects- Specified by:
retrieveAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- Array of Persistence-Capable objects
-
retrieveAll
public void retrieveAll(Object[] pcs, boolean fgOnly)
Retrieve field values of instances from the store. This tells thePersistenceManagerthat the application intends to use the instances, and their field values should be retrieved. The fields in the current fetch group must be retrieved, and the implementation might retrieve more fields than the current fetch-group.The
PersistenceManagermight use policy information about the class to retrieve associated instances.- Parameters:
pcs- the instancesfgOnly- whether to retrieve only the current fetch-group fields- Since:
- JDO 1.0.1
-
retrieveAll
public void retrieveAll(boolean fgOnly, Object... pcs)Retrieve field values of instances from the store.- Specified by:
retrieveAllin interfacejavax.jdo.PersistenceManager- Parameters:
fgOnly- whether to retrieve only the current fetch-group fieldspcs- the instances- Since:
- JDO 2.1
-
retrieveAll
public void retrieveAll(Collection pcs, boolean fgOnly)
Retrieve field values of instances from the store. This tells thePersistenceManagerthat the application intends to use the instances, and their field values should be retrieved. The fields in the current fetch group must be retrieved, and the implementation might retrieve more fields than the current fetch-group.The
PersistenceManagermight use policy information about the class to retrieve associated instances.- Specified by:
retrieveAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- the instancesfgOnly- whether to retrieve only the current fetch group fields- Since:
- JDO 1.0.1
-
currentTransaction
public javax.jdo.Transaction currentTransaction()
Accessor for the current transaction- Specified by:
currentTransactionin interfacejavax.jdo.PersistenceManager- Returns:
- The current transaction
-
evict
public void evict(Object o)
Method to evict an object- Specified by:
evictin interfacejavax.jdo.PersistenceManager- Parameters:
o- Object to evict
-
evictAll
public void evictAll(Object... os)
Method to evict an array of objects- Specified by:
evictAllin interfacejavax.jdo.PersistenceManager- Parameters:
os- Array of objects to evict
-
evictAll
public void evictAll(Collection os)
Method to evict all of the specified objects from the PM.- Specified by:
evictAllin interfacejavax.jdo.PersistenceManager- Parameters:
os- Collection of objects to evict
-
evictAll
public void evictAll(Class cls, boolean subclasses)
Method to evict all objects of the specified type (and optionally its subclasses).- Parameters:
cls- Type of persistable objectsubclasses- Whether to include subclasses
-
evictAll
public void evictAll(boolean subclasses, Class cls)Method to evict all objects of the specified type (and optionally its subclasses).- Specified by:
evictAllin interfacejavax.jdo.PersistenceManager- Parameters:
subclasses- Whether to include subclassescls- Type of persistable object
-
evictAll
public void evictAll()
Method to evict all objects from the PM.- Specified by:
evictAllin interfacejavax.jdo.PersistenceManager
-
refreshAll
public void refreshAll(Object... os)
Method to refresh an array of objects.- Specified by:
refreshAllin interfacejavax.jdo.PersistenceManager- Parameters:
os- Array of objects to refresh
-
refreshAll
public void refreshAll(Collection os)
Method to refresh a collection of objects.- Specified by:
refreshAllin interfacejavax.jdo.PersistenceManager- Parameters:
os- Collection of objects to refresh
-
refreshAll
public void refreshAll(javax.jdo.JDOException exc)
Method to refresh objects that failed verification in a JDOException- Specified by:
refreshAllin interfacejavax.jdo.PersistenceManager- Parameters:
exc- Exception containing objects that failed verification
-
refreshAll
public void refreshAll()
Method to refresh all objects in the Persistence Manager.- Specified by:
refreshAllin interfacejavax.jdo.PersistenceManager
-
newQuery
public javax.jdo.Query newQuery()
Accessor for a new query.- Specified by:
newQueryin interfacejavax.jdo.PersistenceManager- Returns:
- The query.
-
newQuery
public javax.jdo.Query newQuery(Object obj)
Accessor for a new query.- Specified by:
newQueryin interfacejavax.jdo.PersistenceManager- Parameters:
obj- object- Returns:
- The new query
-
newQuery
public javax.jdo.Query newQuery(String query)
Accessor for a single-string query.- Specified by:
newQueryin interfacejavax.jdo.PersistenceManager- Parameters:
query- The single-string query- Returns:
- The Query
-
newQuery
public javax.jdo.Query newQuery(String language, Object query)
Accessor for a new query in the specified query language etc.- Specified by:
newQueryin interfacejavax.jdo.PersistenceManager- Parameters:
language- The query languagequery- The query definition- Returns:
- The new query
-
newQuery
public javax.jdo.Query newQuery(Class cls)
Accessor for a new query using this candidate class.- Specified by:
newQueryin interfacejavax.jdo.PersistenceManager- Parameters:
cls- The candidate class to use.- Returns:
- The new query
-
newQuery
public javax.jdo.Query newQuery(javax.jdo.Extent ext)
Accessor for a new query based on the provided extent.- Specified by:
newQueryin interfacejavax.jdo.PersistenceManager- Parameters:
ext- The extent to use- Returns:
- The new query
-
newQuery
public javax.jdo.Query newQuery(Class cls, Collection cln)
Accessor for a new query.- Specified by:
newQueryin interfacejavax.jdo.PersistenceManager- Parameters:
cls- The candidate class.cln- The collection to use.- Returns:
- The new query
-
newQuery
public javax.jdo.Query newQuery(Class cls, String filter)
Accessor for a new query.- Specified by:
newQueryin interfacejavax.jdo.PersistenceManager- Parameters:
cls- The candidate classfilter- The filter to use- Returns:
- The new query
-
newQuery
public javax.jdo.Query newQuery(Class cls, Collection cln, String filter)
Accessor for a new query.- Specified by:
newQueryin interfacejavax.jdo.PersistenceManager- Parameters:
cls- The candidate classcln- The collectionfilter- The filter to use- Returns:
- The new query
-
newQuery
public javax.jdo.Query newQuery(javax.jdo.Extent cln, String filter)Accessor for a new query.- Specified by:
newQueryin interfacejavax.jdo.PersistenceManager- Parameters:
cln- The collectionfilter- The filter to use- Returns:
- The new query
-
newJDOQLTypedQuery
public <T> javax.jdo.JDOQLTypedQuery<T> newJDOQLTypedQuery(Class<T> cls)
- Specified by:
newJDOQLTypedQueryin interfacejavax.jdo.PersistenceManager
-
newNamedQuery
public javax.jdo.Query newNamedQuery(Class cls, String queryName)
Accessor for a new named query.- Specified by:
newNamedQueryin interfacejavax.jdo.PersistenceManager- Parameters:
cls- The candidate classqueryName- The name of the query- Returns:
- The new query
-
getExtent
public javax.jdo.Extent getExtent(Class cls, boolean subclasses)
Accessor for the extent of a candidate class.- Specified by:
getExtentin interfacejavax.jdo.PersistenceManager- Parameters:
cls- The candidate classsubclasses- Whether to include subclasses- Returns:
- The extent for these classes
-
getExtent
public javax.jdo.Extent getExtent(Class cls)
Accessor for the extent of a candidate class.- Specified by:
getExtentin interfacejavax.jdo.PersistenceManager- Parameters:
cls- The candidate class- Returns:
- The extent for these classes
-
getFetchPlan
public javax.jdo.FetchPlan getFetchPlan()
Accessor for the current FetchPlan- Specified by:
getFetchPlanin interfacejavax.jdo.PersistenceManager- Returns:
- FetchPlan
-
getObjectById
public Object getObjectById(Object id)
Accessor for an object given its id.- Specified by:
getObjectByIdin interfacejavax.jdo.PersistenceManager- Parameters:
id- Id of the object.- Returns:
- The object with this id
-
getObjectById
public Object getObjectById(Object id, boolean validate)
Accessor for an object given its id.- Specified by:
getObjectByIdin interfacejavax.jdo.PersistenceManager- Parameters:
id- Id of the object.validate- Whether to validate the object before returning it- Returns:
- The object with this id
-
getObjectsById
public Collection getObjectsById(Collection oids)
- Specified by:
getObjectsByIdin interfacejavax.jdo.PersistenceManager
-
getObjectsById
public Object[] getObjectsById(Object... oids)
- Specified by:
getObjectsByIdin interfacejavax.jdo.PersistenceManager
-
getObjectsById
public Collection getObjectsById(Collection oids, boolean validate)
- Specified by:
getObjectsByIdin interfacejavax.jdo.PersistenceManager
-
getObjectsById
public Object[] getObjectsById(boolean validate, Object... oids)
- Specified by:
getObjectsByIdin interfacejavax.jdo.PersistenceManager
-
getObjectById
public Object getObjectById(Class cls, Object key)
- Specified by:
getObjectByIdin interfacejavax.jdo.PersistenceManager
-
newObjectIdInstance
public Object newObjectIdInstance(Class pcClass, Object key)
- Specified by:
newObjectIdInstancein interfacejavax.jdo.PersistenceManager
-
getObjectId
public Object getObjectId(Object pc)
Accessor for the id of an object.- Specified by:
getObjectIdin interfacejavax.jdo.PersistenceManager- Parameters:
pc- The object- Returns:
- The objects id
-
getTransactionalObjectId
public Object getTransactionalObjectId(Object pc)
- Specified by:
getTransactionalObjectIdin interfacejavax.jdo.PersistenceManager
-
newInstance
public Object newInstance(Class pc)
Method to create an instance of an interface or abstract class- Specified by:
newInstancein interfacejavax.jdo.PersistenceManager- Parameters:
pc- interface/abstract class declared in metadata- Returns:
- Instance of the interface / abstract class
-
makePersistent
public Object makePersistent(Object pc)
Method to make an object persistent.- Specified by:
makePersistentin interfacejavax.jdo.PersistenceManager- Parameters:
pc- The object to persist
-
makePersistentAll
public Object[] makePersistentAll(Object... pcs)
Make an array of Persistent Capable objects persistent- Specified by:
makePersistentAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- Array of Persistent Capable objects
-
makePersistentAll
public Collection makePersistentAll(Collection pcs)
Make a Collection of Persistence Capable objects persistent- Specified by:
makePersistentAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- Collection of Persistence Capable objects
-
deletePersistent
public void deletePersistent(Object pc)
JDO method to delete a Persistence Capable object- Specified by:
deletePersistentin interfacejavax.jdo.PersistenceManager- Parameters:
pc- Persistence Capable object
-
deletePersistentAll
public void deletePersistentAll(Object... pcs)
JDO method to delete an array of Persistence Capable objects- Specified by:
deletePersistentAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- Array of Persistence Capable objects
-
deletePersistentAll
public void deletePersistentAll(Collection pcs)
JDO method to delete a Collection of Persistence Capable objects- Specified by:
deletePersistentAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- Collection of Persistence Capable objects
-
makeTransient
public void makeTransient(Object pc, boolean useFetchPlan)
Make a Persistence-Capable object transient , optionally using the fetch plan.- Specified by:
makeTransientin interfacejavax.jdo.PersistenceManager- Parameters:
pc- Persistence-Capable objectuseFetchPlan- Whether to use the fetch plan
-
makeTransientAll
public void makeTransientAll(Object[] pcs, boolean useFetchPlan)
Make an array of Persistence-Capable objects transient- Parameters:
pcs- Array of Persistence-Capable objectsuseFetchPlan- Whether to use the fetch plan
-
makeTransientAll
public void makeTransientAll(boolean useFetchPlan, Object... pcs)Make an array of Persistence-Capable objects transient- Specified by:
makeTransientAllin interfacejavax.jdo.PersistenceManager- Parameters:
useFetchPlan- Whether to use the fetch planpcs- Array of Persistence-Capable objects- Since:
- JDO 2.1
-
makeTransientAll
public void makeTransientAll(Collection pcs, boolean useFetchPlan)
Make a Collection of Persistence-Capable objects transient- Specified by:
makeTransientAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- Collection of Persistence-Capable objectsuseFetchPlan- Whether to use the fetch plan
-
makeTransient
public void makeTransient(Object pc)
Make a Persistence-Capable object transient- Specified by:
makeTransientin interfacejavax.jdo.PersistenceManager- Parameters:
pc- Persistence-Capable object
-
makeTransientAll
public void makeTransientAll(Object... pcs)
Make an array of Persistence-Capable objects transient- Specified by:
makeTransientAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- Array of Persistence-Capable objects
-
makeTransientAll
public void makeTransientAll(Collection pcs)
Make a Collection of Persistence-Capable objects transient- Specified by:
makeTransientAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- Collection of Persistence-Capable objects
-
makeTransactional
public void makeTransactional(Object pc)
Make a Persistence-Capable object transient- Specified by:
makeTransactionalin interfacejavax.jdo.PersistenceManager- Parameters:
pc- Persistence-Capable object
-
makeTransactionalAll
public void makeTransactionalAll(Object... pcs)
Make an array of Persistence-Capable objects transactional- Specified by:
makeTransactionalAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- Array of Persistence-Capable objects
-
makeTransactionalAll
public void makeTransactionalAll(Collection pcs)
Make a collection of persistable objects transactional- Specified by:
makeTransactionalAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- Collection of persistable objects
-
makeNontransactional
public void makeNontransactional(Object pc)
Make a Persistence-Capable object non-transactional- Specified by:
makeNontransactionalin interfacejavax.jdo.PersistenceManager- Parameters:
pc- Persistence-Capable object
-
makeNontransactionalAll
public void makeNontransactionalAll(Object... pcs)
Make an array of Persistence-Capable objects non-transactional- Specified by:
makeNontransactionalAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- Array of Persistence-Capable objects
-
makeNontransactionalAll
public void makeNontransactionalAll(Collection pcs)
Make a Collection of Persistence-Capable objects non-transactional- Specified by:
makeNontransactionalAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- Collection of Persistence-Capable objects
-
detachCopy
public Object detachCopy(Object pc)
Detach the specified object from thePersistenceManager.- Specified by:
detachCopyin interfacejavax.jdo.PersistenceManager- Parameters:
pc- the instance to detach- Returns:
- the detached instance
- Since:
- JDO 2.0
- See Also:
detachCopyAll(Object[])
-
detachCopyAll
public Object[] detachCopyAll(Object... pcs)
Detach the specified objects from thePersistenceManager. The objects returned can be manipulated and re-attached withmakePersistentAll(Object[]). The detached instances will be unmanaged copies of the specified parameters, and are suitable for serialization and manipulation outside of a JDO environment. When detaching instances, only fields in the currentFetchPlanwill be traversed. Thus, to detach a graph of objects, relations to other persistent instances must either be in thedefault-fetch-group, or in the current customFetchPlan.- Specified by:
detachCopyAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- the instances to detach- Returns:
- the detached instances
- Throws:
javax.jdo.JDOUserException- if any of the instances do not- See Also:
makePersistentAll(Object[]),getFetchPlan()
-
detachCopyAll
public Collection detachCopyAll(Collection pcs)
Detach the specified objects from thePersistenceManager.- Specified by:
detachCopyAllin interfacejavax.jdo.PersistenceManager- Parameters:
pcs- the instances to detach- Returns:
- the detached instances
- See Also:
detachCopyAll(Object[])
-
putUserObject
public Object putUserObject(Object key, Object value)
Method to put a user object into the PersistenceManager. This is so that multiple users can each have a user object for example. The parameter is not inspected or used in any way by the JDO implementation.- Specified by:
putUserObjectin interfacejavax.jdo.PersistenceManager- Parameters:
key- The key to store the user object undervalue- The object to store- Returns:
- The previous value for this key
- Since:
- 1.1
-
getUserObject
public Object getUserObject(Object key)
Method to get a user object from the PersistenceManager. This is for user objects which are stored under a key. The parameter is not inspected or used in any way by the JDO implementation.- Specified by:
getUserObjectin interfacejavax.jdo.PersistenceManager- Parameters:
key- The key to store the user object under- Returns:
- The user object for that key
- Since:
- 1.1
-
removeUserObject
public Object removeUserObject(Object key)
Method to remove a user object from the PersistenceManager. This is for user objects which are stored under a key. The parameter is not inspected or used in any way by the JDO implementation.- Specified by:
removeUserObjectin interfacejavax.jdo.PersistenceManager- Parameters:
key- The key whose user object is to be removed.- Returns:
- The user object that was removed
- Since:
- 1.1
-
setUserObject
public void setUserObject(Object obj)
The application might manage PersistenceManager instances by using an associated object for bookkeeping purposes. These methods allow the user to manage the associated object. The parameter is not inspected or used in any way by the JDO implementation.- Specified by:
setUserObjectin interfacejavax.jdo.PersistenceManager- Parameters:
obj- User Object
-
getUserObject
public Object getUserObject()
The application might manage PersistenceManager instances by using an associated object for bookkeeping purposes. These methods allow the user to manage the associated object. The parameter is not inspected or used in any way by the JDO implementation.*- Specified by:
getUserObjectin interfacejavax.jdo.PersistenceManager- Returns:
- User object
-
getPersistenceManagerFactory
public javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory()
Retrieve the PersistenceManagerFactory for this manager- Specified by:
getPersistenceManagerFactoryin interfacejavax.jdo.PersistenceManager- Returns:
- The PersistenceManagerFactory
-
getObjectIdClass
public Class getObjectIdClass(Class clazz)
Retrieve the class for the objectid- Specified by:
getObjectIdClassin interfacejavax.jdo.PersistenceManager- Parameters:
clazz- The class to retrieve- Returns:
- The Class of the ObjectId
-
setMultithreaded
public void setMultithreaded(boolean multithreaded)
Mutator for the multithreaded capability of the manager- Specified by:
setMultithreadedin interfacejavax.jdo.PersistenceManager- Parameters:
multithreaded- Whether to run multithreaded or not
-
getMultithreaded
public boolean getMultithreaded()
Accessor for the multithreaded capability of the manager- Specified by:
getMultithreadedin interfacejavax.jdo.PersistenceManager- Returns:
- Whether the PersistenceManager is multithreaded or not
-
setIgnoreCache
public void setIgnoreCache(boolean ignore)
Mutator for whether to ignore the cache or not- Specified by:
setIgnoreCachein interfacejavax.jdo.PersistenceManager- Parameters:
ignore- Whether to ignore the cache or not
-
getIgnoreCache
public boolean getIgnoreCache()
Accessor for whether to ignore the cache or not- Specified by:
getIgnoreCachein interfacejavax.jdo.PersistenceManager- Returns:
- Whether to ignore the cache or not
-
flush
public void flush()
This method flushes all dirty, new, and deleted instances to the datastore. It has no effect if a transaction is not active. If a datastore transaction is active, this method synchronizes the cache with the datastore and reports any exceptions. If an optimistic transaction is active, this method obtains a datastore connection and synchronizes the cache with the datastore using this connection. The connection obtained by this method is held until the end of the transaction.- Specified by:
flushin interfacejavax.jdo.PersistenceManager
-
checkConsistency
public void checkConsistency()
Method to check the consistency of the cache.- Specified by:
checkConsistencyin interfacejavax.jdo.PersistenceManager
-
getDataStoreConnection
public javax.jdo.datastore.JDOConnection getDataStoreConnection()
(non-Javadoc)- Specified by:
getDataStoreConnectionin interfacejavax.jdo.PersistenceManager- Since:
- 1.1
- See Also:
PersistenceManager.getDataStoreConnection()
-
getSequence
public javax.jdo.datastore.Sequence getSequence(String sequenceName)
Accessor for a Sequence.- Specified by:
getSequencein interfacejavax.jdo.PersistenceManager- Parameters:
sequenceName- Name of the sequence- Returns:
- The sequence
-
addInstanceLifecycleListener
public void addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener, Class... classes)JDO 2.0 spec 12.15 "LifecycleListeners".- Specified by:
addInstanceLifecycleListenerin interfacejavax.jdo.PersistenceManager- Parameters:
listener- The instance lifecycle listener to sends events toclasses- The classes that it is interested in- Since:
- 1.1
-
removeInstanceLifecycleListener
public void removeInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener)
JDO 2.0 spec 12.15 "LifecycleListeners".- Specified by:
removeInstanceLifecycleListenerin interfacejavax.jdo.PersistenceManager- Parameters:
listener- The instance lifecycle listener to remove.- Since:
- 1.1
-
getServerDate
public Date getServerDate()
Accessor for the server date/time.- Specified by:
getServerDatein interfacejavax.jdo.PersistenceManager- Returns:
- The server date/time
-
getCopyOnAttach
public boolean getCopyOnAttach()
- Specified by:
getCopyOnAttachin interfacejavax.jdo.PersistenceManager
-
setCopyOnAttach
public void setCopyOnAttach(boolean flag)
- Specified by:
setCopyOnAttachin interfacejavax.jdo.PersistenceManager
-
getManagedObjects
public Set getManagedObjects()
- Specified by:
getManagedObjectsin interfacejavax.jdo.PersistenceManager
-
getManagedObjects
public Set getManagedObjects(Class... classes)
- Specified by:
getManagedObjectsin interfacejavax.jdo.PersistenceManager
-
getManagedObjects
public Set getManagedObjects(EnumSet states)
- Specified by:
getManagedObjectsin interfacejavax.jdo.PersistenceManager
-
getManagedObjects
public Set getManagedObjects(EnumSet states, Class... classes)
- Specified by:
getManagedObjectsin interfacejavax.jdo.PersistenceManager
-
getFetchGroup
public javax.jdo.FetchGroup getFetchGroup(Class cls, String name)
- Specified by:
getFetchGroupin interfacejavax.jdo.PersistenceManager
-
getDatastoreReadTimeoutMillis
public Integer getDatastoreReadTimeoutMillis()
- Specified by:
getDatastoreReadTimeoutMillisin interfacejavax.jdo.PersistenceManager
-
setDatastoreReadTimeoutMillis
public void setDatastoreReadTimeoutMillis(Integer intvl)
- Specified by:
setDatastoreReadTimeoutMillisin interfacejavax.jdo.PersistenceManager
-
getDatastoreWriteTimeoutMillis
public Integer getDatastoreWriteTimeoutMillis()
- Specified by:
getDatastoreWriteTimeoutMillisin interfacejavax.jdo.PersistenceManager
-
setDatastoreWriteTimeoutMillis
public void setDatastoreWriteTimeoutMillis(Integer intvl)
- Specified by:
setDatastoreWriteTimeoutMillisin interfacejavax.jdo.PersistenceManager
-
getProperties
public Map<String,Object> getProperties()
- Specified by:
getPropertiesin interfacejavax.jdo.PersistenceManager
-
getSupportedProperties
public Set<String> getSupportedProperties()
- Specified by:
getSupportedPropertiesin interfacejavax.jdo.PersistenceManager
-
-