|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpox.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)
Add opened query results to the pm |
void |
addQueryRun(java.lang.String singleStringQuery)
Add queries already run to the pm |
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)
Whether the query was already run |
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)
Remove query results from the pm |
void |
removeQueryRun(java.lang.String singleStringQuery)
Remove query results from the pm |
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 datastoreMethod Detail |
public ClassLoaderResolver getClassLoaderResolver()
getClassLoaderResolver
in interface PersistenceManager
public StoreManager getStoreManager()
getStoreManager
in interface PersistenceManager
public javax.jdo.FetchPlan getFetchPlan()
getFetchPlan
in interface javax.jdo.PersistenceManager
public AbstractPersistenceManagerFactory getAbstractPersistenceManagerFactory()
public javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory()
getPersistenceManagerFactory
in interface javax.jdo.PersistenceManager
public PMFContext getPMFContext()
getPMFContext
in interface PersistenceManager
public MetaDataManager getMetaDataManager()
getMetaDataManager
in interface PersistenceManager
public abstract PersistenceManager getPMHandle()
getPMHandle
in interface PersistenceManager
public boolean isDelayDatastoreOperationsEnabled()
isDelayDatastoreOperationsEnabled
in interface PersistenceManager
public java.sql.Connection getConnection(boolean forWriting, boolean forQuery) throws java.sql.SQLException
getConnection
in interface PersistenceManager
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
getConnection
in interface PersistenceManager
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()
isConnectionOpen
in interface PersistenceManager
public void releaseConnection(java.sql.Connection conn) throws java.sql.SQLException
releaseConnection
in interface PersistenceManager
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.PersistenceManager
public void enlistInTransaction(StateManager sm)
enlistInTransaction
in interface PersistenceManager
sm
- The StateManagerpublic void evictFromTransaction(StateManager sm)
evictFromTransaction
in interface PersistenceManager
sm
- The StateManagerpublic void addStateManager(StateManager sm)
addStateManager
in interface PersistenceManager
sm
- The StateManagerpublic void removeStateManager(StateManager sm)
removeStateManager
in interface PersistenceManager
sm
- The StateManagerpublic StateManager getStateManagerById(java.lang.Object id)
getStateManagerById
in interface PersistenceManager
id
- Id of the object.
public boolean isClosed()
isClosed
in interface javax.jdo.PersistenceManager
public void close()
close
in interface javax.jdo.PersistenceManager
protected void disconnectSMCache()
protected void reset()
protected void disconnectQueryCache()
protected void disconnectLifecycleListener()
public void evict(java.lang.Object pc)
evict
in interface javax.jdo.PersistenceManager
pc
- The objectpublic void evictAll(java.lang.Object[] pcs)
evictAll
in interface javax.jdo.PersistenceManager
pcs
- The objectspublic void evictAll(java.util.Collection pcs)
evictAll
in interface javax.jdo.PersistenceManager
pcs
- The objects
javax.jdo.JDOUserException
- thrown if some instances could not be evictedpublic void evictAll()
evictAll
in interface javax.jdo.PersistenceManager
public void refresh(java.lang.Object pc)
refresh
in interface javax.jdo.PersistenceManager
pc
- The Objectpublic void refreshAll(java.lang.Object[] pcs)
refreshAll
in interface javax.jdo.PersistenceManager
pcs
- The Objectspublic void refreshAll(java.util.Collection pcs)
refreshAll
in interface javax.jdo.PersistenceManager
pcs
- The Objects
javax.jdo.JDOUserException
- thrown if instances could not be refreshed.public void refreshAll()
refreshAll
in interface javax.jdo.PersistenceManager
javax.jdo.JDOUserException
- thrown if instances could not be refreshed.public void refreshAll(javax.jdo.JDOException exc)
refreshAll
in interface javax.jdo.PersistenceManager
exc
- The JDO exception containing the objects that failedpublic void internalRetrieve(java.lang.Object obj, javax.jdo.FetchPlan fetchPlan)
obj
- The objectfetchPlan
- the fetch plan to load fieldspublic void retrieve(java.lang.Object pc, boolean fgOnly)
retrieve
in interface javax.jdo.PersistenceManager
pc
- The objectfgOnly
- Whether to retrieve the current fetch group fields onlypublic 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.PersistenceManager
pc
- The objectpublic void retrieveAll(java.lang.Object[] pcs)
retrieveAll
in interface javax.jdo.PersistenceManager
pcs
- The objectspublic 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.PersistenceManager
pcs
- the instancesfgOnly
- whether to retrieve only the current fetch group fieldspublic 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.PersistenceManager
pcs
- the instancesfgOnly
- whether to retrieve only the current fetch-group fieldspublic void retrieveAll(java.util.Collection pcs)
retrieveAll
in interface javax.jdo.PersistenceManager
pcs
- The objectspublic java.lang.Object makePersistentInternal(java.lang.Object obj, FieldValues preInsertChanges)
makePersistentInternal
in interface PersistenceManager
obj
- The objectpreInsertChanges
- Changes to be made before inserting
public java.lang.Object makePersistent(java.lang.Object obj)
makePersistent
in interface javax.jdo.PersistenceManager
obj
- The objectpublic java.lang.Object[] makePersistentAll(java.lang.Object[] pcs)
makePersistentAll
in interface javax.jdo.PersistenceManager
pcs
- The objects to persistpublic java.util.Collection makePersistentAll(java.util.Collection pcs)
makePersistentAll
in interface javax.jdo.PersistenceManager
pcs
- The objects to persistpublic boolean isInserting(javax.jdo.spi.PersistenceCapable pc)
isInserting
in interface PersistenceManager
pc
- the object to verify the status
public java.lang.Object attachCopy(java.lang.Object pc, boolean embedded)
attachCopy
in interface PersistenceManager
pc
- The objectembedded
- Whether the object is embedded
public void deletePersistent(java.lang.Object obj)
deletePersistent
in interface javax.jdo.PersistenceManager
obj
- The objectpublic void deletePersistentAll(java.lang.Object[] pcs)
deletePersistentAll
in interface javax.jdo.PersistenceManager
pcs
- The objectspublic void deletePersistentAll(java.util.Collection pcs)
deletePersistentAll
in interface javax.jdo.PersistenceManager
pcs
- The objectspublic void makeTransientInternal(java.lang.Object obj, FetchPlanState state)
makeTransientInternal
in interface PersistenceManager
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.PersistenceManager
pc
- The objectuseFetchPlan
- Whether to make transient all objects in the fetch planpublic void makeTransient(java.lang.Object pc)
makeTransient
in interface javax.jdo.PersistenceManager
pc
- The objectpublic void makeTransientAll(java.lang.Object[] pcs)
makeTransientAll
in interface javax.jdo.PersistenceManager
pcs
- The objectspublic void makeTransientAll(java.lang.Object[] pcs, boolean includeFetchPlan)
makeTransientAll
in interface javax.jdo.PersistenceManager
pcs
- The objectsincludeFetchPlan
- Whether to make transient all objects in the fetch planpublic void makeTransientAll(java.util.Collection pcs, boolean useFetchPlan)
makeTransientAll
in interface javax.jdo.PersistenceManager
pcs
- 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.PersistenceManager
pcs
- 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.PersistenceManager
pc
- The objectpublic void makeTransactionalAll(java.lang.Object[] pcs)
makeTransactionalAll
in interface javax.jdo.PersistenceManager
pcs
- The objectspublic void makeTransactionalAll(java.util.Collection pcs)
makeTransactionalAll
in interface javax.jdo.PersistenceManager
pcs
- The objects
javax.jdo.JDOUserException
- thrown if objects could not be made transactionalpublic void makeNontransactional(java.lang.Object pc)
makeNontransactional
in interface javax.jdo.PersistenceManager
pc
- The objectpublic void makeNontransactionalAll(java.lang.Object[] pcs)
makeNontransactionalAll
in interface javax.jdo.PersistenceManager
pcs
- The objects.public void makeNontransactionalAll(java.util.Collection pcs)
makeNontransactionalAll
in interface javax.jdo.PersistenceManager
pcs
- The objects.
javax.jdo.JDOUserException
- thrown if objects could not be made nontransactionalpublic void detachInternal(java.lang.Object pc, FetchPlanState state)
detachInternal
in interface PersistenceManager
pc
- The objectstate
- State for the detachment processpublic java.lang.Object detachCopyInternal(java.lang.Object pc, FetchPlanState state)
detachCopyInternal
in interface PersistenceManager
pc
- The objectstate
- The detached state
public java.lang.Object detachCopy(java.lang.Object pc)
detachCopy
in interface javax.jdo.PersistenceManager
pc
- 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.PersistenceManager
pcs
- 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.PersistenceManager
pcs
- the instances to detach
detachCopyAll(Object[])
public javax.jdo.Query newQuery()
newQuery
in interface javax.jdo.PersistenceManager
public javax.jdo.Query newQuery(java.lang.Object obj)
newQuery
in interface javax.jdo.PersistenceManager
obj
- The object to use in the query
public javax.jdo.Query newQuery(java.lang.String query)
newQuery
in interface javax.jdo.PersistenceManager
query
- The single-string query
public javax.jdo.Query newQuery(java.lang.String language, java.lang.Object query)
newQuery
in interface javax.jdo.PersistenceManager
language
- 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.PersistenceManager
cls
- The class to query
public javax.jdo.Query newQuery(javax.jdo.Extent cln)
newQuery
in interface javax.jdo.PersistenceManager
cln
- The extent to query
public javax.jdo.Query newQuery(java.lang.Class cls, java.util.Collection cln)
newQuery
in interface javax.jdo.PersistenceManager
cls
- The class to querycln
- The collection
public javax.jdo.Query newQuery(java.lang.Class cls, java.lang.String filter)
newQuery
in interface javax.jdo.PersistenceManager
cls
- 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.PersistenceManager
cls
- 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.PersistenceManager
cln
- 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.PersistenceManager
cls
- The class to queryqueryName
- Name of the query.
public javax.jdo.Extent getExtent(java.lang.Class pcClass, boolean subclasses)
getExtent
in interface javax.jdo.PersistenceManager
pcClass
- 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.PersistenceManager
pcClass
- The class to query
public java.lang.Object newInstance(java.lang.Class persistenceCapable)
newInstance
in interface javax.jdo.PersistenceManager
persistenceCapable
- 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.PersistenceManager
pcClass
- 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)
getObjectByAID
in interface PersistenceManager
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)
getObjectById
in interface PersistenceManager
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.PersistenceManager
id
- Id of the object.
public java.lang.Object getObjectById(java.lang.Object id, boolean validate)
getObjectById
in interface javax.jdo.PersistenceManager
id
- Id of the object.validate
- Whether to validate the object state
public java.lang.Object getObjectById(java.lang.Object id, boolean validate, boolean checkInheritance)
getObjectById
in interface PersistenceManager
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.PersistenceManager
oids
- 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.PersistenceManager
oids
- 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.PersistenceManager
oids
- Ids of the objects.
public java.lang.Object[] getObjectsById(java.lang.Object[] oids)
getObjectsById
in interface javax.jdo.PersistenceManager
oids
- Ids of the objects.
public java.lang.Object getObjectById(java.lang.Class cls, java.lang.Object key)
getObjectById
in interface javax.jdo.PersistenceManager
cls
- 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)
getObjectById
in interface PersistenceManager
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.PersistenceManager
pc
- The object
public java.lang.Object getTransactionalObjectId(java.lang.Object pc)
getTransactionalObjectId
in interface javax.jdo.PersistenceManager
pc
- The object
public java.lang.Object putUserObject(java.lang.Object key, java.lang.Object value)
putUserObject
in interface javax.jdo.PersistenceManager
key
- 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.PersistenceManager
key
- The key to store the user object under
public java.lang.Object removeUserObject(java.lang.Object key)
removeUserObject
in interface javax.jdo.PersistenceManager
key
- The key whose uder object is to be removed.
public void setUserObject(java.lang.Object userObject)
setUserObject
in interface javax.jdo.PersistenceManager
userObject
- The objectpublic java.lang.Object getUserObject()
getUserObject
in interface javax.jdo.PersistenceManager
public java.lang.Class getObjectIdClass(java.lang.Class cls)
getObjectIdClass
in interface javax.jdo.PersistenceManager
cls
- The class name of the object
public void setMultithreaded(boolean flag)
setMultithreaded
in interface javax.jdo.PersistenceManager
flag
- Whether to run multithreaded.public boolean getMultithreaded()
getMultithreaded
in interface javax.jdo.PersistenceManager
public void setIgnoreCache(boolean flag)
setIgnoreCache
in interface javax.jdo.PersistenceManager
flag
- Whether to ignore the cache.public boolean getIgnoreCache()
getIgnoreCache
in interface javax.jdo.PersistenceManager
public void setDetachOnClose(boolean flag)
flag
- Whether to detach on close.public boolean getDetachOnClose()
public void setDetachAllOnCommit(boolean flag)
setDetachAllOnCommit
in interface javax.jdo.PersistenceManager
flag
- Whether to detach all on commit.public boolean getDetachAllOnCommit()
getDetachAllOnCommit
in interface javax.jdo.PersistenceManager
public StateManager findStateManager(javax.jdo.spi.PersistenceCapable pc)
findStateManager
in interface PersistenceManager
pc
- The object
public void hereIsStateManager(StateManager sm, javax.jdo.spi.PersistenceCapable pc)
hereIsStateManager
in interface PersistenceManager
sm
- The StateManagerpc
- The object managed by the StateManagerpublic void clearDirty(StateManager sm)
clearDirty
in interface PersistenceManager
sm
- The StateManagerpublic void markDirty(StateManager sm)
markDirty
in interface PersistenceManager
sm
- The StateManagerpublic void clearDirty()
public void flush()
flush
in interface javax.jdo.PersistenceManager
public void checkConsistency()
checkConsistency
in interface javax.jdo.PersistenceManager
public void preCommit()
public void postCommit()
public void preRollback()
public void dump(java.lang.Object obj, java.io.PrintWriter out)
dump
in interface PersistenceManager
obj
- The PersistenceCapable objectout
- The PrintWriterpublic javax.jdo.datastore.Sequence getSequence(java.lang.String sequenceName)
getSequence
in interface javax.jdo.PersistenceManager
sequenceName
- Fully qualified name of the sequence
public void replaceObjectId(javax.jdo.spi.PersistenceCapable pc, java.lang.Object oldID, java.lang.Object newID)
replaceObjectId
in interface PersistenceManager
pc
- The Persistence Capable objectoldID
- the old idnewID
- the new idpublic void putObjectIntoCache(StateManager sm, boolean level1, boolean level2)
putObjectIntoCache
in interface PersistenceManager
sm
- The State Managerlevel1
- Whether to put it in the L1 cachelevel2
- Whether to put it in the L2 cachepublic void removeObjectFromCache(javax.jdo.spi.PersistenceCapable pc, java.lang.Object id, boolean level1, boolean level2)
removeObjectFromCache
in interface PersistenceManager
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.PersistenceManager
listener
- 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.PersistenceManager
listener
- The instance lifecycle listener to remove.public void notifyLifecycleListenersForEvent(java.lang.Object obj, int lifecycleEventType, java.lang.Object otherObj)
notifyLifecycleListenersForEvent
in interface PersistenceManager
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)
PersistenceManager
addQueryResult
in interface PersistenceManager
queryResult
- The result to addpublic void removeQueryResult(QueryResult queryResult)
PersistenceManager
removeQueryResult
in interface PersistenceManager
queryResult
- The result to removepublic void addQueryRun(java.lang.String singleStringQuery)
PersistenceManager
addQueryRun
in interface PersistenceManager
singleStringQuery
- public boolean hasQueryRun(java.lang.String singleStringQuery)
PersistenceManager
hasQueryRun
in interface PersistenceManager
singleStringQuery
-
public void removeQueryRun(java.lang.String singleStringQuery)
PersistenceManager
removeQueryRun
in interface PersistenceManager
singleStringQuery
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |