|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.AbstractPersistenceManager
public abstract class AbstractPersistenceManager
This class implements the functionality needed for a JDO persistence manager.
| Field Summary | |
|---|---|
protected AbstractPersistenceManagerFactory |
apmf
Owning PMF for this PM. |
protected ClassLoaderResolver |
clr
The ClassLoader resolver to use for class loading issues. |
protected java.util.List |
lifecycleListeners
Lifecycle Listeners for events |
protected static Localiser |
LOCALISER
Localisation utility for output messages |
protected Transaction |
tx
Current transaction |
| Constructor Summary | |
|---|---|
AbstractPersistenceManager(AbstractPersistenceManagerFactory apmf,
java.lang.String userName,
java.lang.String password)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener,
java.lang.Class[] classes)
Method to register a lifecycle listener as per JDO 2.0 spec 12.15. |
void |
addQueryResult(QueryResult queryResult)
|
void |
addQueryRun(java.lang.String singleStringQuery)
|
void |
addStateManager(StateManager sm)
Method to add the object managed by the specified StateManager to the cache. |
java.lang.Object |
attachCopy(java.lang.Object pc,
boolean embedded)
Method to attach a persistent detached object. |
void |
checkConsistency()
This method validates the cache with the datastore. |
void |
clearDirty()
Method to mark as clean the StateManager. |
void |
clearDirty(StateManager sm)
Method to mark an object (StateManager) as dirty. |
void |
close()
Method to close the Persistence Manager. |
javax.jdo.Transaction |
currentTransaction()
Accessor for the current transaction. |
void |
deletePersistent(java.lang.Object obj)
JDO method to delete an object from the datastore. |
void |
deletePersistentAll(java.util.Collection pcs)
JDO method to delete a collection of objects from the datastore. |
void |
deletePersistentAll(java.lang.Object[] pcs)
JDO method to delete an array of objects from the datastore. |
java.lang.Object |
detachCopy(java.lang.Object pc)
JDO method to detach a persistent object. |
java.util.Collection |
detachCopyAll(java.util.Collection pcs)
Detach the specified objects from the PersistenceManager. |
java.lang.Object[] |
detachCopyAll(java.lang.Object[] pcs)
Detach the specified objects from the PersistenceManager. |
java.lang.Object |
detachCopyInternal(java.lang.Object pc,
FetchPlanState state)
Internal method to detach a persistent object using the passed state. |
void |
detachInternal(java.lang.Object pc,
FetchPlanState state)
Method to detach a persistent object without making a copy. |
protected void |
disconnectLifecycleListener()
Disconnect the registered LifecycleListener |
protected void |
disconnectQueryCache()
Disconnect Query Results cache to close it, and disconnect the list of queries that has been run |
protected void |
disconnectSMCache()
Disconnect SM instances, clear cache and reset settings |
void |
dump(java.lang.Object obj,
java.io.PrintWriter out)
Diagnostic method to dump out the state of the passed object to the passed PrintWriter. |
void |
enlistInTransaction(StateManager sm)
Method to enlist the specified StateManager in the current transaction. |
void |
evict(java.lang.Object pc)
Method to evict an object. |
void |
evictAll()
Method to evict all current objects. |
void |
evictAll(java.util.Collection pcs)
Method to evict a collection of objects. |
void |
evictAll(java.lang.Object[] pcs)
Method to evict an array of objects. |
void |
evictFromTransaction(StateManager sm)
Method to evict the specified StateManager from the current transaction. |
StateManager |
findStateManager(javax.jdo.spi.PersistenceCapable pc)
Method to find the StateManager for an object. |
void |
flush()
This method flushes all dirty, new, and deleted instances to the datastore. |
AbstractPersistenceManagerFactory |
getAbstractPersistenceManagerFactory()
Accessor for the PersistenceManager Factory. |
ClassLoaderResolver |
getClassLoaderResolver()
Accessor for the ClassLoaderResolver |
java.sql.Connection |
getConnection(boolean forWriting,
boolean forQuery)
Accessor for a Connection for this datastore. |
java.sql.Connection |
getConnection(boolean forWriting,
boolean forQuery,
boolean useOpenedConnection)
Accessor for the connection to the datasource. |
boolean |
getDetachAllOnCommit()
Accessor for whether to detach all objects on commit of the transaction. |
boolean |
getDetachOnClose()
Accessor for whether to detach objects on close of the PM. |
javax.jdo.Extent |
getExtent(java.lang.Class pcClass)
Extents are collections of datastore objects managed by the datastore, not by explicit user operations on collections. |
javax.jdo.Extent |
getExtent(java.lang.Class pcClass,
boolean subclasses)
Extents are collections of datastore objects managed by the datastore, not by explicit user operations on collections. |
javax.jdo.FetchPlan |
getFetchPlan()
Acessor for the current FetchPlan |
boolean |
getIgnoreCache()
Accessor for whether to ignore the cache. |
MetaDataManager |
getMetaDataManager()
Accessor for the MetaDataManager for this PMF. |
boolean |
getMultithreaded()
Accessor for whether the Persistence Manager is multithreaded. |
java.lang.Object |
getObjectByAID(java.lang.Class pcClass,
FieldValues fv,
boolean ignoreCache,
boolean checkInheritance)
Accessor for the StateManager of an object given the object AID. |
java.lang.Object |
getObjectById(java.lang.Class cls,
java.lang.Object key)
Convenience method that exactly matches the behavior of calling pm.getObjectById (pm.newObjectIdInstance (cls, key), true). |
java.lang.Object |
getObjectById(java.lang.Object id)
Accessor for an object given the object id. |
java.lang.Object |
getObjectById(java.lang.Object id,
boolean validate)
Accessor for an object given the object id. |
java.lang.Object |
getObjectById(java.lang.Object id,
boolean validate,
boolean checkInheritance)
Accessor for an object given the object id. |
java.lang.Object |
getObjectById(java.lang.Object id,
FieldValues fv)
Accessor for an object given the object id. |
java.lang.Object |
getObjectById(java.lang.Object id,
FieldValues fv,
java.lang.Class cls,
boolean ignoreCache)
Accessor for an object given the object id. |
javax.jdo.spi.PersistenceCapable |
getObjectFromCache(java.lang.Object id)
Convenience method to access an object in the cache. |
java.lang.Object |
getObjectId(java.lang.Object pc)
Accessor for an object id given the object. |
java.lang.Class |
getObjectIdClass(java.lang.Class cls)
Accessor for the class of the object id given the class of object. |
java.util.Collection |
getObjectsById(java.util.Collection oids)
Accessor for the objects given the object ids, validating the objects. |
java.util.Collection |
getObjectsById(java.util.Collection oids,
boolean validate)
Accessor for the objects given the object ids. |
java.lang.Object[] |
getObjectsById(java.lang.Object[] oids)
Accessor for the objects given the object ids, validating the objects. |
java.lang.Object[] |
getObjectsById(java.lang.Object[] oids,
boolean validate)
Accessor for the objects given the object ids. |
javax.jdo.PersistenceManagerFactory |
getPersistenceManagerFactory()
Accessor for the PersistenceManager Factory. |
PMFContext |
getPMFContext()
Gets the context in which this PersistenceManager is running |
abstract PersistenceManager |
getPMHandle()
Accessor for a handle to this PersistenceManager. |
javax.jdo.datastore.Sequence |
getSequence(java.lang.String sequenceName)
Method to retrieve a sequence by name. |
StateManager |
getStateManagerById(java.lang.Object id)
Accessor for the StateManager of an object given the object id. |
StoreManager |
getStoreManager()
Accessor for the Store Manager. |
java.lang.Object |
getTransactionalObjectId(java.lang.Object pc)
Accessor for the object id of a transactional object given the object. |
java.lang.Object |
getUserObject()
The application might manage PersistenceManager instances by using an associated object for bookkeeping purposes. |
java.lang.Object |
getUserObject(java.lang.Object key)
Method to get a user object from the PersistenceManager. |
boolean |
hasQueryRun(java.lang.String singleStringQuery)
|
void |
hereIsStateManager(StateManager sm,
javax.jdo.spi.PersistenceCapable pc)
Method to add the StateManager for an object to this PersistenceManager's list. |
void |
internalRetrieve(java.lang.Object obj,
javax.jdo.FetchPlan fetchPlan)
Method to retrieve an object (internally). |
boolean |
isClosed()
Accessor for whether this Persistence Manager is closed. |
boolean |
isConnectionOpen()
Checks whether a connection to the datasource is open. |
boolean |
isDelayDatastoreOperationsEnabled()
Whether the datastore operations are delayed until commit. |
boolean |
isInserting(javax.jdo.spi.PersistenceCapable pc)
Tests whether this object is in the process of being inserted. |
void |
makeNontransactional(java.lang.Object pc)
Method to make nontransactional an object. |
void |
makeNontransactionalAll(java.util.Collection pcs)
Method to make nontransactional a collection of objects. |
void |
makeNontransactionalAll(java.lang.Object[] pcs)
Method to make nontransactional an array of objects. |
java.lang.Object |
makePersistent(java.lang.Object obj)
JDO method to make persistent an object. |
java.util.Collection |
makePersistentAll(java.util.Collection pcs)
JDO method to make persistent a collection of objects. |
java.lang.Object[] |
makePersistentAll(java.lang.Object[] pcs)
JDO method to make persistent an array of objects. |
java.lang.Object |
makePersistentInternal(java.lang.Object obj,
FieldValues preInsertChanges)
Internal method to make persistent an object. |
void |
makeTransactional(java.lang.Object pc)
Method to make transactional an object. |
void |
makeTransactionalAll(java.util.Collection pcs)
Method to make transactional a collection of objects. |
void |
makeTransactionalAll(java.lang.Object[] pcs)
Method to make transactional an array of objects. |
void |
makeTransient(java.lang.Object pc)
Method to make transient an object. |
void |
makeTransient(java.lang.Object pc,
boolean useFetchPlan)
Method to make transient an object allowing fetching using the fetch plan. |
void |
makeTransientAll(java.util.Collection pcs)
Method to make transient a collection of objects. |
void |
makeTransientAll(java.util.Collection pcs,
boolean useFetchPlan)
Method to make transient a collection of objects. |
void |
makeTransientAll(java.lang.Object[] pcs)
Method to make transient an array of objects. |
void |
makeTransientAll(java.lang.Object[] pcs,
boolean includeFetchPlan)
Method to make transient an array of objects. |
void |
makeTransientInternal(java.lang.Object obj,
FetchPlanState state)
Method to make transient an object (internally). |
void |
markDirty(StateManager sm)
Method to mark an object (StateManager) as dirty. |
java.lang.Object |
newInstance(java.lang.Class persistenceCapable)
Method to generate an instance of an interface, abstract class, or concrete PC class. |
javax.jdo.Query |
newNamedQuery(java.lang.Class cls,
java.lang.String queryName)
Construct a query instance with the candidate class and the query name. |
java.lang.Object |
newObjectIdInstance(java.lang.Class pcClass,
java.lang.Object key)
This method returns an object id instance corresponding to the pcClass and key arguments. |
javax.jdo.Query |
newQuery()
Construct an empty query instance. |
javax.jdo.Query |
newQuery(java.lang.Class cls)
Construct a query instance with the candidate class specified. |
javax.jdo.Query |
newQuery(java.lang.Class cls,
java.util.Collection cln)
Construct a query instance with the candidate class and candidate Collection specified. |
javax.jdo.Query |
newQuery(java.lang.Class cls,
java.util.Collection cln,
java.lang.String filter)
Construct a query instance with the candidate class, the candidate Collection, and filter specified. |
javax.jdo.Query |
newQuery(java.lang.Class cls,
java.lang.String filter)
Construct a query instance with the candidate class and filter specified. |
javax.jdo.Query |
newQuery(javax.jdo.Extent cln)
Construct a query instance with the candidate Extent specified; the candidate class is taken from the Extent. |
javax.jdo.Query |
newQuery(javax.jdo.Extent cln,
java.lang.String filter)
Construct a query instance with the candidate Extent and filter specified. |
javax.jdo.Query |
newQuery(java.lang.Object obj)
Construct a query instance from another query. |
javax.jdo.Query |
newQuery(java.lang.String query)
Construct a query instance using the specified Single-String query. |
javax.jdo.Query |
newQuery(java.lang.String language,
java.lang.Object query)
Construct a query instance using the specified language and the specified query. |
void |
notifyLifecycleListenersForEvent(java.lang.Object obj,
int lifecycleEventType,
java.lang.Object otherObj)
Utility to notify the lifecycle listeners for an event on an object. |
void |
postCommit()
Commit any changes made to objects managed by the persistence manager to the database. |
void |
preCommit()
Method to perform any pre-commit checks. |
void |
preRollback()
Rollback any changes made to objects managed by the persistence manager to the database. |
void |
putObjectIntoCache(StateManager sm,
boolean level1,
boolean level2)
Convenience method to add an object to the cache(s). |
java.lang.Object |
putUserObject(java.lang.Object key,
java.lang.Object value)
Method to put a user object into the PersistenceManager. |
void |
refresh(java.lang.Object pc)
Method to do a refresh of an object. |
void |
refreshAll()
Method to do a refresh of all objects. |
void |
refreshAll(java.util.Collection pcs)
Method to do a refresh of a collection of objects. |
void |
refreshAll(javax.jdo.JDOException exc)
Method to do a refresh of objects that failed verification in the exception. |
void |
refreshAll(java.lang.Object[] pcs)
Method to do a refresh of an array of objects. |
void |
releaseConnection(java.sql.Connection conn)
Method to return a Connection for this datastore to the pool. |
void |
removeAllInstanceLifecycleListeners()
This method removes all previously registered lifecycle listeners. |
void |
removeInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener)
Method to remove a currently registered lifecycle listener, as per JDO 2.0 spec 12.15. |
void |
removeObjectFromCache(javax.jdo.spi.PersistenceCapable pc,
java.lang.Object id,
boolean level1,
boolean level2)
Convenience method to evict an object from the cache(s). |
void |
removeQueryResult(QueryResult queryResult)
|
void |
removeQueryRun(java.lang.String singleStringQuery)
|
void |
removeStateManager(StateManager sm)
Method to remove the object managed by the specified StateManager from the cache. |
java.lang.Object |
removeUserObject(java.lang.Object key)
Method to remove a user object from the PersistenceManager. |
void |
replaceObjectId(javax.jdo.spi.PersistenceCapable pc,
java.lang.Object oldID,
java.lang.Object newID)
Replace the previous object id for a PC object to a new |
protected void |
reset()
Reset the PersistenceManager |
void |
retrieve(java.lang.Object pc)
Method to retrieve the fields of an object. |
void |
retrieve(java.lang.Object pc,
boolean fgOnly)
Method to retrieve the fields of an object. |
void |
retrieve(java.lang.Object pc,
javax.jdo.FetchPlan fetchPlan)
Method to retrieve the fields of an object. |
void |
retrieveAll(java.util.Collection pcs)
Method to retrieve a collection of objects. |
void |
retrieveAll(java.util.Collection pcs,
boolean fgOnly)
Retrieve field values of instances from the store. |
void |
retrieveAll(java.lang.Object[] pcs)
Method to retrieve an array of objects. |
void |
retrieveAll(java.lang.Object[] pcs,
boolean fgOnly)
Retrieve field values of instances from the store. |
void |
setDetachAllOnCommit(boolean flag)
Mutator for whether to detach all objects on commit of the transaction. |
void |
setDetachOnClose(boolean flag)
Mutator for whether to detach objects on close of the PM. |
void |
setIgnoreCache(boolean flag)
Mutator for whether to ignore the cache. |
void |
setMultithreaded(boolean flag)
Mutator for whether the Persistence Manager is multithreaded. |
void |
setUserObject(java.lang.Object userObject)
The application might manage PersistenceManager instances by using an associated object for bookkeeping purposes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.jdo.PersistenceManager |
|---|
getDataStoreConnection |
| Field Detail |
|---|
protected static final Localiser LOCALISER
protected final AbstractPersistenceManagerFactory apmf
protected Transaction tx
protected java.util.List lifecycleListeners
protected ClassLoaderResolver clr
| Constructor Detail |
|---|
public AbstractPersistenceManager(AbstractPersistenceManagerFactory apmf,
java.lang.String userName,
java.lang.String password)
apmf - Persistence Manager FactoryuserName - Username for the datastorepassword - Password for the datastore| Method Detail |
|---|
public ClassLoaderResolver getClassLoaderResolver()
public StoreManager getStoreManager()
public javax.jdo.FetchPlan getFetchPlan()
getFetchPlan in interface javax.jdo.PersistenceManagerpublic AbstractPersistenceManagerFactory getAbstractPersistenceManagerFactory()
public javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory()
getPersistenceManagerFactory in interface javax.jdo.PersistenceManagerpublic PMFContext getPMFContext()
public MetaDataManager getMetaDataManager()
public abstract PersistenceManager getPMHandle()
public boolean isDelayDatastoreOperationsEnabled()
public java.sql.Connection getConnection(boolean forWriting,
boolean forQuery)
throws java.sql.SQLException
forWriting - Whether the connection can be used for writesforQuery - Whether the connection is to be used by a query (i.e.JDOQUERY).
java.sql.SQLException - Thrown if an error occurs in the creation of the
connection.
public java.sql.Connection getConnection(boolean forWriting,
boolean forQuery,
boolean useOpenedConnection)
throws java.sql.SQLException
forWriting - Whether the connection is read-only or read-write.forQuery - Whether the connection is to be used by a query (i.e.JDOQUERY).useOpenedConnection - whether to use an already opened connection, if one is opened.
java.sql.SQLException - When a problem occurs getting the connection.public boolean isConnectionOpen()
public void releaseConnection(java.sql.Connection conn)
throws java.sql.SQLException
conn - The Connection
java.sql.SQLException - Thrown if an error occurs in the release of the
connection.public javax.jdo.Transaction currentTransaction()
currentTransaction in interface javax.jdo.PersistenceManagerpublic void enlistInTransaction(StateManager sm)
sm - The StateManagerpublic void evictFromTransaction(StateManager sm)
sm - The StateManagerpublic void addStateManager(StateManager sm)
sm - The StateManagerpublic void removeStateManager(StateManager sm)
sm - The StateManagerpublic StateManager getStateManagerById(java.lang.Object id)
id - Id of the object.
public boolean isClosed()
isClosed in interface javax.jdo.PersistenceManagerpublic void close()
close in interface javax.jdo.PersistenceManagerprotected void disconnectSMCache()
protected void reset()
protected void disconnectQueryCache()
protected void disconnectLifecycleListener()
public void evict(java.lang.Object pc)
evict in interface javax.jdo.PersistenceManagerpc - The objectpublic void evictAll(java.lang.Object[] pcs)
evictAll in interface javax.jdo.PersistenceManagerpcs - The objectspublic void evictAll(java.util.Collection pcs)
evictAll in interface javax.jdo.PersistenceManagerpcs - The objects
javax.jdo.JDOUserException - thrown if some instances could not be evictedpublic void evictAll()
evictAll in interface javax.jdo.PersistenceManagerpublic void refresh(java.lang.Object pc)
refresh in interface javax.jdo.PersistenceManagerpc - The Objectpublic void refreshAll(java.lang.Object[] pcs)
refreshAll in interface javax.jdo.PersistenceManagerpcs - The Objectspublic void refreshAll(java.util.Collection pcs)
refreshAll in interface javax.jdo.PersistenceManagerpcs - The Objects
javax.jdo.JDOUserException - thrown if instances could not be refreshed.public void refreshAll()
refreshAll in interface javax.jdo.PersistenceManagerjavax.jdo.JDOUserException - thrown if instances could not be refreshed.public void refreshAll(javax.jdo.JDOException exc)
refreshAll in interface javax.jdo.PersistenceManagerexc - The JDO exception containing the objects that failed
public void internalRetrieve(java.lang.Object obj,
javax.jdo.FetchPlan fetchPlan)
obj - The objectfetchPlan - the fetch plan to load fields
public void retrieve(java.lang.Object pc,
boolean fgOnly)
retrieve in interface javax.jdo.PersistenceManagerpc - The objectfgOnly - Whether to retrieve the current fetch group fields only
public void retrieve(java.lang.Object pc,
javax.jdo.FetchPlan fetchPlan)
pc - The objectfetchPlan - the fetch plan to load fieldspublic void retrieve(java.lang.Object pc)
retrieve in interface javax.jdo.PersistenceManagerpc - The objectpublic void retrieveAll(java.lang.Object[] pcs)
retrieveAll in interface javax.jdo.PersistenceManagerpcs - The objects
public void retrieveAll(java.lang.Object[] pcs,
boolean fgOnly)
PersistenceManager that 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 PersistenceManager might use policy information about
the class to retrieve associated instances.
retrieveAll in interface javax.jdo.PersistenceManagerpcs - the instancesfgOnly - whether to retrieve only the current fetch group fields
public void retrieveAll(java.util.Collection pcs,
boolean fgOnly)
PersistenceManager that 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 PersistenceManager might use policy information about
the class to retrieve associated instances.
retrieveAll in interface javax.jdo.PersistenceManagerpcs - the instancesfgOnly - whether to retrieve only the current fetch-group fieldspublic void retrieveAll(java.util.Collection pcs)
retrieveAll in interface javax.jdo.PersistenceManagerpcs - The objects
public java.lang.Object makePersistentInternal(java.lang.Object obj,
FieldValues preInsertChanges)
obj - The object
public java.lang.Object makePersistent(java.lang.Object obj)
makePersistent in interface javax.jdo.PersistenceManagerobj - The objectpublic java.lang.Object[] makePersistentAll(java.lang.Object[] pcs)
makePersistentAll in interface javax.jdo.PersistenceManagerpcs - The objects to persistpublic java.util.Collection makePersistentAll(java.util.Collection pcs)
makePersistentAll in interface javax.jdo.PersistenceManagerpcs - The objects to persistpublic boolean isInserting(javax.jdo.spi.PersistenceCapable pc)
pc - the object to verify the status
public java.lang.Object attachCopy(java.lang.Object pc,
boolean embedded)
pc - The objectembedded - Whether the object is embedded
public void deletePersistent(java.lang.Object obj)
deletePersistent in interface javax.jdo.PersistenceManagerobj - The objectpublic void deletePersistentAll(java.lang.Object[] pcs)
deletePersistentAll in interface javax.jdo.PersistenceManagerpcs - The objectspublic void deletePersistentAll(java.util.Collection pcs)
deletePersistentAll in interface javax.jdo.PersistenceManagerpcs - The objects
public void makeTransientInternal(java.lang.Object obj,
FetchPlanState state)
obj - The objectstate - Object containing the state of the fetch plan process (if any)
public void makeTransient(java.lang.Object pc,
boolean useFetchPlan)
makeTransient in interface javax.jdo.PersistenceManagerpc - The objectuseFetchPlan - Whether to make transient all objects in the fetch planpublic void makeTransient(java.lang.Object pc)
makeTransient in interface javax.jdo.PersistenceManagerpc - The objectpublic void makeTransientAll(java.lang.Object[] pcs)
makeTransientAll in interface javax.jdo.PersistenceManagerpcs - The objects
public void makeTransientAll(java.lang.Object[] pcs,
boolean includeFetchPlan)
makeTransientAll in interface javax.jdo.PersistenceManagerpcs - The objectsincludeFetchPlan - Whether to make transient all objects in the fetch plan
public void makeTransientAll(java.util.Collection pcs,
boolean useFetchPlan)
makeTransientAll in interface javax.jdo.PersistenceManagerpcs - The objectsuseFetchPlan - Whether to use the fetch plan when making transient
javax.jdo.JDOUserException - thrown if objects could not be made transient.public void makeTransientAll(java.util.Collection pcs)
makeTransientAll in interface javax.jdo.PersistenceManagerpcs - The objects
javax.jdo.JDOUserException - thrown if objects could not be made transient.public void makeTransactional(java.lang.Object pc)
makeTransactional in interface javax.jdo.PersistenceManagerpc - The objectpublic void makeTransactionalAll(java.lang.Object[] pcs)
makeTransactionalAll in interface javax.jdo.PersistenceManagerpcs - The objectspublic void makeTransactionalAll(java.util.Collection pcs)
makeTransactionalAll in interface javax.jdo.PersistenceManagerpcs - The objects
javax.jdo.JDOUserException - thrown if objects could not be made transactionalpublic void makeNontransactional(java.lang.Object pc)
makeNontransactional in interface javax.jdo.PersistenceManagerpc - The objectpublic void makeNontransactionalAll(java.lang.Object[] pcs)
makeNontransactionalAll in interface javax.jdo.PersistenceManagerpcs - The objects.public void makeNontransactionalAll(java.util.Collection pcs)
makeNontransactionalAll in interface javax.jdo.PersistenceManagerpcs - The objects.
javax.jdo.JDOUserException - thrown if objects could not be made nontransactional
public void detachInternal(java.lang.Object pc,
FetchPlanState state)
pc - The objectstate - State for the detachment process
public java.lang.Object detachCopyInternal(java.lang.Object pc,
FetchPlanState state)
pc - The objectstate - The detached state
public java.lang.Object detachCopy(java.lang.Object pc)
detachCopy in interface javax.jdo.PersistenceManagerpc - The object
public java.lang.Object[] detachCopyAll(java.lang.Object[] pcs)
PersistenceManager.
The objects returned can be manipulated and re-attached with
makePersistentAll(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 current FetchPlan 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 FetchPlan.
detachCopyAll in interface javax.jdo.PersistenceManagerpcs - the instances to detach
javax.jdo.JDOUserException - if any of the instances do not
ClassNotDetachableException - If any of the objects are of a class that is not detachablepublic java.util.Collection detachCopyAll(java.util.Collection pcs)
PersistenceManager.
detachCopyAll in interface javax.jdo.PersistenceManagerpcs - the instances to detach
detachCopyAll(Object[])public javax.jdo.Query newQuery()
newQuery in interface javax.jdo.PersistenceManagerpublic javax.jdo.Query newQuery(java.lang.Object obj)
newQuery in interface javax.jdo.PersistenceManagerobj - The object to use in the query
public javax.jdo.Query newQuery(java.lang.String query)
newQuery in interface javax.jdo.PersistenceManagerquery - The single-string query
public javax.jdo.Query newQuery(java.lang.String language,
java.lang.Object query)
newQuery in interface javax.jdo.PersistenceManagerlanguage - The language parameter for the JDO Query language. This
is by default "javax.jdo.query.JDOQL", but in JDO 2.0 can also be
"javax.jdo.query.SQL", or vendor provided languages.query - The query object
public javax.jdo.Query newQuery(java.lang.Class cls)
newQuery in interface javax.jdo.PersistenceManagercls - The class to query
public javax.jdo.Query newQuery(javax.jdo.Extent cln)
newQuery in interface javax.jdo.PersistenceManagercln - The extent to query
public javax.jdo.Query newQuery(java.lang.Class cls,
java.util.Collection cln)
newQuery in interface javax.jdo.PersistenceManagercls - The class to querycln - The collection
public javax.jdo.Query newQuery(java.lang.Class cls,
java.lang.String filter)
newQuery in interface javax.jdo.PersistenceManagercls - The class to queryfilter - A filter to apply
public javax.jdo.Query newQuery(java.lang.Class cls,
java.util.Collection cln,
java.lang.String filter)
newQuery in interface javax.jdo.PersistenceManagercls - The class to querycln - A collectionfilter - A filter to apply
public javax.jdo.Query newQuery(javax.jdo.Extent cln,
java.lang.String filter)
newQuery in interface javax.jdo.PersistenceManagercln - The extent to queryfilter - A filter to apply
public javax.jdo.Query newNamedQuery(java.lang.Class cls,
java.lang.String queryName)
newNamedQuery in interface javax.jdo.PersistenceManagercls - The class to queryqueryName - Name of the query.
public javax.jdo.Extent getExtent(java.lang.Class pcClass,
boolean subclasses)
getExtent in interface javax.jdo.PersistenceManagerpcClass - The class to querysubclasses - Whether to include subclasses in the query.
public javax.jdo.Extent getExtent(java.lang.Class pcClass)
getExtent in interface javax.jdo.PersistenceManagerpcClass - The class to query
public java.lang.Object newInstance(java.lang.Class persistenceCapable)
newInstance in interface javax.jdo.PersistenceManagerpersistenceCapable - The class of the interface or abstract class, or concrete class defined in MetaData
public java.lang.Object newObjectIdInstance(java.lang.Class pcClass,
java.lang.Object key)
newObjectIdInstance in interface javax.jdo.PersistenceManagerpcClass - Class of the PersistenceCapable to create the OID for.key - Value of the key for SingleFieldIdentity
public java.lang.Object getObjectByAID(java.lang.Class pcClass,
FieldValues fv,
boolean ignoreCache,
boolean checkInheritance)
pcClass - The class of the PC objectfv - The field values to be loadedignoreCache - true if it must ignore the cachecheckInheritance - Whether look to the database to determine which
class this object is. This parameter is a hint. Set false, if it's
already determined the correct pcClass for this pc "object" in a certain
level in the hierarchy. Set to true and it will look to the database.
public java.lang.Object getObjectById(java.lang.Object id,
FieldValues fv,
java.lang.Class cls,
boolean ignoreCache)
id - Id of the object.fv - Field values for the objectcls - the type which the object is. This type will be used to instanciat the objectignoreCache - true if it must ignore the cache
public java.lang.Object getObjectById(java.lang.Object id)
getObjectById in interface javax.jdo.PersistenceManagerid - Id of the object.
public java.lang.Object getObjectById(java.lang.Object id,
boolean validate)
getObjectById in interface javax.jdo.PersistenceManagerid - Id of the object.validate - Whether to validate the object state
public java.lang.Object getObjectById(java.lang.Object id,
boolean validate,
boolean checkInheritance)
id - Id of the object.validate - Whether to validate the object statecheckInheritance - Whether look to the database to determine which
class this object is.
public java.util.Collection getObjectsById(java.util.Collection oids,
boolean validate)
getObjectsById in interface javax.jdo.PersistenceManageroids - Ids of the objects.validate - Whether to validate the object state
public java.lang.Object[] getObjectsById(java.lang.Object[] oids,
boolean validate)
getObjectsById in interface javax.jdo.PersistenceManageroids - Ids of the objects.validate - Whether to validate the object state
public java.util.Collection getObjectsById(java.util.Collection oids)
getObjectsById in interface javax.jdo.PersistenceManageroids - Ids of the objects.
public java.lang.Object[] getObjectsById(java.lang.Object[] oids)
getObjectsById in interface javax.jdo.PersistenceManageroids - Ids of the objects.
public java.lang.Object getObjectById(java.lang.Class cls,
java.lang.Object key)
getObjectById in interface javax.jdo.PersistenceManagercls - Class of the PersistenceCapablekey - Value of the key field for SingleFieldIdentity, or the string value of the key otherwise
public java.lang.Object getObjectById(java.lang.Object id,
FieldValues fv)
id - Id of the object.fv - Field values for the object
public java.lang.Object getObjectId(java.lang.Object pc)
getObjectId in interface javax.jdo.PersistenceManagerpc - The object
public java.lang.Object getTransactionalObjectId(java.lang.Object pc)
getTransactionalObjectId in interface javax.jdo.PersistenceManagerpc - The object
public java.lang.Object putUserObject(java.lang.Object key,
java.lang.Object value)
putUserObject in interface javax.jdo.PersistenceManagerkey - The key to store the user object undervalue - The object to store
public java.lang.Object getUserObject(java.lang.Object key)
getUserObject in interface javax.jdo.PersistenceManagerkey - The key to store the user object under
public java.lang.Object removeUserObject(java.lang.Object key)
removeUserObject in interface javax.jdo.PersistenceManagerkey - The key whose uder object is to be removed.
public void setUserObject(java.lang.Object userObject)
setUserObject in interface javax.jdo.PersistenceManageruserObject - The objectpublic java.lang.Object getUserObject()
getUserObject in interface javax.jdo.PersistenceManagerpublic java.lang.Class getObjectIdClass(java.lang.Class cls)
getObjectIdClass in interface javax.jdo.PersistenceManagercls - The class name of the object
public void setMultithreaded(boolean flag)
setMultithreaded in interface javax.jdo.PersistenceManagerflag - Whether to run multithreaded.public boolean getMultithreaded()
getMultithreaded in interface javax.jdo.PersistenceManagerpublic void setIgnoreCache(boolean flag)
setIgnoreCache in interface javax.jdo.PersistenceManagerflag - Whether to ignore the cache.public boolean getIgnoreCache()
getIgnoreCache in interface javax.jdo.PersistenceManagerpublic void setDetachOnClose(boolean flag)
flag - Whether to detach on close.public boolean getDetachOnClose()
public void setDetachAllOnCommit(boolean flag)
setDetachAllOnCommit in interface javax.jdo.PersistenceManagerflag - Whether to detach all on commit.public boolean getDetachAllOnCommit()
getDetachAllOnCommit in interface javax.jdo.PersistenceManagerpublic StateManager findStateManager(javax.jdo.spi.PersistenceCapable pc)
pc - The object
public void hereIsStateManager(StateManager sm,
javax.jdo.spi.PersistenceCapable pc)
sm - The StateManagerpc - The object managed by the StateManagerpublic void clearDirty(StateManager sm)
sm - The StateManagerpublic void markDirty(StateManager sm)
sm - The StateManagerpublic void clearDirty()
public void flush()
flush in interface javax.jdo.PersistenceManagerpublic void checkConsistency()
checkConsistency in interface javax.jdo.PersistenceManagerpublic void preCommit()
public void postCommit()
public void preRollback()
public void dump(java.lang.Object obj,
java.io.PrintWriter out)
obj - The PersistenceCapable objectout - The PrintWriterpublic javax.jdo.datastore.Sequence getSequence(java.lang.String sequenceName)
getSequence in interface javax.jdo.PersistenceManagersequenceName - Fully qualified name of the sequence
public void replaceObjectId(javax.jdo.spi.PersistenceCapable pc,
java.lang.Object oldID,
java.lang.Object newID)
pc - The Persistence Capable objectoldID - the old idnewID - the new id
public void putObjectIntoCache(StateManager sm,
boolean level1,
boolean level2)
sm - The State Managerlevel1 - Whether to put it in the L1 cachelevel2 - Whether to put it in the L2 cache
public void removeObjectFromCache(javax.jdo.spi.PersistenceCapable pc,
java.lang.Object id,
boolean level1,
boolean level2)
pc - The PersistenceCapable objectid - The PersistenceCapable object idlevel1 - Whether to evict from the L1 cachelevel2 - Whether to evict from the L2 cachepublic javax.jdo.spi.PersistenceCapable getObjectFromCache(java.lang.Object id)
id - Id of the object
public void removeAllInstanceLifecycleListeners()
public void addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener,
java.lang.Class[] classes)
addInstanceLifecycleListener in interface javax.jdo.PersistenceManagerlistener - The instance lifecycle listener to sends events toclasses - The classes that it is interested inpublic void removeInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener)
removeInstanceLifecycleListener in interface javax.jdo.PersistenceManagerlistener - The instance lifecycle listener to remove.
public void notifyLifecycleListenersForEvent(java.lang.Object obj,
int lifecycleEventType,
java.lang.Object otherObj)
obj - The object that had the operation performed on itlifecycleEventType - The lifecycle eventotherObj - Other object associated with the event (if any)public void addQueryResult(QueryResult queryResult)
public void removeQueryResult(QueryResult queryResult)
public void addQueryRun(java.lang.String singleStringQuery)
public boolean hasQueryRun(java.lang.String singleStringQuery)
public void removeQueryRun(java.lang.String singleStringQuery)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||