PersistenceManager
is the primary interface for JDO-aware application
components. It is the factory for Query
and Transaction
instances,
and contains methods to manage the life cycle of PersistenceCapable
instances.
A PersistenceManager
is obtained from the
PersistenceManagerFactory
(recommended) or by construction.
Method Summary | |
void |
close()
Close this PersistenceManager so that no further requests may be
made on it. |
Transaction |
currentTransaction()
Return the Transaction instance associated with a PersistenceManager . |
void |
deletePersistent(java.lang.Object pc)
Delete the persistent instance from the data store. |
void |
deletePersistentAll(java.util.Collection pcs)
Delete a Collection of instances from the data store. |
void |
deletePersistentAll(java.lang.Object[] pcs)
Delete an array of instances from the data store. |
void |
evict(java.lang.Object pc)
Mark an instance as no longer needed in the cache. |
void |
evictAll()
Mark all persistent-nontransactional instances as no longer needed in the cache. |
void |
evictAll(java.util.Collection pcs)
Mark a Collection of instances as no longer needed in the cache. |
void |
evictAll(java.lang.Object[] pcs)
Mark an array of instances as no longer needed in the cache. |
Extent |
getExtent(java.lang.Class persistenceCapableClass,
boolean subclasses)
The PersistenceManager manages a collection of instances in the data
store based on the class of the instances. |
boolean |
getIgnoreCache()
Get the ignoreCache setting for queries. |
boolean |
getMultithreaded()
Get the current Multithreaded flag for this PersistenceManager . |
java.lang.Object |
getObjectById(java.lang.Object oid,
boolean validate)
This method locates a persistent instance in the cache of instances managed by this PersistenceManager . |
java.lang.Object |
getObjectId(java.lang.Object pc)
The ObjectId returned by this method represents the JDO identity of the instance. |
java.lang.Class |
getObjectIdClass(java.lang.Class cls)
Return the Class that implements the JDO Identity for the
specified PersistenceCapable class. |
PersistenceManagerFactory |
getPersistenceManagerFactory()
This method returns the PersistenceManagerFactory used to create
this PersistenceManager . |
java.lang.Object |
getTransactionalObjectId(java.lang.Object pc)
The ObjectId returned by this method represents the JDO identity of the instance. |
java.lang.Object |
getUserObject()
The application can manage the PersistenceManager instances
more easily by having an application object associated with each
PersistenceManager instance. |
boolean |
isClosed()
A PersistenceManager instance can be used until it is closed. |
void |
makeNontransactional(java.lang.Object pc)
Make an instance non-transactional after commit. |
void |
makeNontransactionalAll(java.util.Collection pcs)
Make a Collection of instances non-transactional after commit. |
void |
makeNontransactionalAll(java.lang.Object[] pcs)
Make an array of instances non-transactional after commit. |
void |
makePersistent(java.lang.Object pc)
Make the transient instance persistent in this PersistenceManager . |
void |
makePersistentAll(java.util.Collection pcs)
Make a Collection of instances persistent. |
void |
makePersistentAll(java.lang.Object[] pcs)
Make an array of instances persistent. |
void |
makeTransactional(java.lang.Object pc)
Make an instance subject to transactional boundaries. |
void |
makeTransactionalAll(java.util.Collection pcs)
Make a Collection of instances subject to transactional boundaries. |
void |
makeTransactionalAll(java.lang.Object[] pcs)
Make an array of instances subject to transactional boundaries. |
void |
makeTransient(java.lang.Object pc)
Make an instance transient, removing it from management by this PersistenceManager . |
void |
makeTransientAll(java.util.Collection pcs)
Make a Collection of instances transient, removing them from
management by this PersistenceManager . |
void |
makeTransientAll(java.lang.Object[] pcs)
Make an array of instances transient, removing them from management by this PersistenceManager . |
java.lang.Object |
newObjectIdInstance(java.lang.Class pcClass,
java.lang.String str)
This method returns an object id instance corresponding to the Class
and String arguments. |
Query |
newQuery()
Create a new Query with no elements. |
Query |
newQuery(java.lang.Class cls)
Create a new Query specifying the Class of the candidate instances. |
Query |
newQuery(java.lang.Class cls,
java.util.Collection cln)
Create a new Query with the candidate Class
and Collection . |
Query |
newQuery(java.lang.Class cls,
java.util.Collection cln,
java.lang.String filter)
Create a new Query with the Class of the candidate instances,
candidate Collection , and filter. |
Query |
newQuery(java.lang.Class cls,
java.lang.String filter)
Create a new Query with the Class of the
candidate instances and filter. |
Query |
newQuery(Extent cln)
Create a new Query with the Class of the
candidate instances and candidate Extent . |
Query |
newQuery(Extent cln,
java.lang.String filter)
Create a new Query with the
candidate Extent and filter; the class
is taken from the Extent . |
Query |
newQuery(java.lang.Object compiled)
Create a new Query using elements from another Query . |
Query |
newQuery(java.lang.String language,
java.lang.Object query)
Create a new Query using the specified language. |
void |
refresh(java.lang.Object pc)
Refresh the state of the instance from the data store. |
void |
refreshAll()
Refresh the state of all applicable instances from the data store. |
void |
refreshAll(java.util.Collection pcs)
Refresh the state of a Collection of instances from the data store. |
void |
refreshAll(java.lang.Object[] pcs)
Refresh the state of an array of instances from the data store. |
void |
retrieve(java.lang.Object pc)
Retrieve an instance from the store. |
void |
retrieveAll(java.util.Collection pcs)
Retrieve instances from the store. |
void |
retrieveAll(java.lang.Object[] pcs)
Retrieve instances from the store. |
void |
setIgnoreCache(boolean flag)
Set the ignoreCache parameter for queries. |
void |
setMultithreaded(boolean flag)
Set the Multithreaded flag for this PersistenceManager . |
void |
setUserObject(java.lang.Object o)
The application can manage the PersistenceManager instances
more easily by having an application object associated with each
PersistenceManager instance. |