org.datanucleus.jdo.connector
Class PersistenceManagerImpl

java.lang.Object
  extended by org.datanucleus.jdo.connector.PersistenceManagerImpl
All Implemented Interfaces:
javax.jdo.PersistenceManager, javax.resource.cci.Connection

public class PersistenceManagerImpl
extends java.lang.Object
implements javax.resource.cci.Connection, javax.jdo.PersistenceManager

Implementation of the PersistenceManager for use in JCA environments. An application handle associated to the ManagedConnectionImpl.


Field Summary
protected static org.datanucleus.util.Localiser LOCALISER
          Localisation utility for output messages
 
Constructor Summary
PersistenceManagerImpl(ManagedConnectionImpl mc)
          Constructor.
 
Method Summary
 void addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener, java.lang.Class[] classes)
          JDO 2.0 spec 12.15 "LifecycleListeners".
 void checkConsistency()
          Method to check the consistency of the cache.
 void close()
          Method to close the Persistence Manager.
 javax.resource.cci.Interaction createInteraction()
           
 javax.jdo.Transaction currentTransaction()
          Accessor for the current transaction
 void deletePersistent(java.lang.Object pc)
          JDO method to delete a Persistence Capable object
 void deletePersistentAll(java.util.Collection pcs)
          JDO method to delete a Collection of Persistence Capable objects
 void deletePersistentAll(java.lang.Object[] pcs)
          JDO method to delete an array of Persistence Capable objects
 java.lang.Object detachCopy(java.lang.Object pc)
          Detach the specified object from the PersistenceManager.
 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.
 void evict(java.lang.Object o)
          Method to evict an object
 void evictAll()
          Method to evict all objects from the PM.
 void evictAll(boolean subclasses, java.lang.Class cls)
          Method to evict all objects of the specified type (and optionaly its subclasses).
 void evictAll(java.lang.Class cls, boolean subclasses)
          Method to evict all objects of the specified type (and optionaly its subclasses).
 void evictAll(java.util.Collection os)
          Method to evict all of the specified objects from the PM.
 void evictAll(java.lang.Object[] os)
          Method to evict an array of objects
 void flush()
          This method flushes all dirty, new, and deleted instances to the datastore.
 boolean getCopyOnAttach()
           
 javax.jdo.datastore.JDOConnection getDataStoreConnection()
          (non-Javadoc)
 boolean getDetachAllOnCommit()
          Accessor for whether to detach objects on commit of the txn.
 javax.jdo.Extent getExtent(java.lang.Class cls)
          Accessor for the extent of a candidate class.
 javax.jdo.Extent getExtent(java.lang.Class cls, boolean subclasses)
          Accessor for the extent of a candidate class.
 javax.jdo.FetchGroup getFetchGroup(java.lang.Class cls, java.lang.String name)
           
 javax.jdo.FetchPlan getFetchPlan()
          Acessor for the current FetchPlan
 boolean getIgnoreCache()
          Accessor for whether to ignore the cache or not
 javax.resource.cci.LocalTransaction getLocalTransaction()
          Accessor for the local transaction.
 java.util.Set getManagedObjects()
           
 java.util.Set getManagedObjects(java.lang.Class[] classes)
           
 java.util.Set getManagedObjects(java.util.EnumSet states)
           
 java.util.Set getManagedObjects(java.util.EnumSet states, java.lang.Class[] classes)
           
 javax.resource.cci.ConnectionMetaData getMetaData()
          Accessor for Meta-Data.
 boolean getMultithreaded()
          Accessor for the multithreaded capability of the manager
 java.lang.Object getObjectById(java.lang.Class cls, java.lang.Object key)
           
 java.lang.Object getObjectById(java.lang.Object id)
          Accessor for an object given its id.
 java.lang.Object getObjectById(java.lang.Object id, boolean validate)
          Accessor for an object given its id.
 java.lang.Object getObjectId(java.lang.Object pc)
          Accessor for the id of an object.
 java.lang.Class getObjectIdClass(java.lang.Class clazz)
          Retrieve the class for the objectid
 java.lang.Object[] getObjectsById(boolean validate, java.lang.Object[] oids)
           
 java.util.Collection getObjectsById(java.util.Collection oids)
           
 java.util.Collection getObjectsById(java.util.Collection oids, boolean validate)
           
 java.lang.Object[] getObjectsById(java.lang.Object[] oids)
           
 java.lang.Object[] getObjectsById(java.lang.Object[] oids, boolean validate)
           
 javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory()
          Retrieve the PersistenceManagerFactory for this manager
 javax.resource.cci.ResultSetInfo getResultSetInfo()
           
 javax.jdo.datastore.Sequence getSequence(java.lang.String sequenceName)
          Accessor for a Sequence.
 java.util.Date getServerDate()
          Accessor for the server date/time.
 java.lang.Object getTransactionalObjectId(java.lang.Object pc)
           
 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 isClosed()
          Accessor for whether the Persistence manager is closed.
 void makeNontransactional(java.lang.Object pc)
          Make a Persistence-Capable object non-transactional
 void makeNontransactionalAll(java.util.Collection pcs)
          Make a Collection of Persistence-Capable objects non-transactional
 void makeNontransactionalAll(java.lang.Object[] pcs)
          Make an array of Persistence-Capable objects non-transactional
 java.lang.Object makePersistent(java.lang.Object pc)
          Method to make an object persistent.
 java.util.Collection makePersistentAll(java.util.Collection pcs)
          Make a Collection of Persistence Capable objects persistent
 java.lang.Object[] makePersistentAll(java.lang.Object[] pcs)
          Make an array of Persistent Capable objects persistent
 void makeTransactional(java.lang.Object pc)
          Make a Persistence-Capable object transient
 void makeTransactionalAll(java.util.Collection pcs)
          Make a collection of PersistenceCapable objects transactional
 void makeTransactionalAll(java.lang.Object[] pcs)
          Make an array of Persistence-Capable objects transactional
 void makeTransient(java.lang.Object pc)
          Make a Persistence-Capable object transient
 void makeTransient(java.lang.Object pc, boolean useFetchPlan)
          Make a Persistence-Capable object transient , optionally using the fetch plan.
 void makeTransientAll(boolean useFetchPlan, java.lang.Object[] pcs)
          Make an array of Persistence-Capable objects transient
 void makeTransientAll(java.util.Collection pcs)
          Make a Collection of Persistence-Capable objects transient
 void makeTransientAll(java.util.Collection pcs, boolean useFetchPlan)
          Make a Collection of Persistence-Capable objects transient
 void makeTransientAll(java.lang.Object[] pcs)
          Make an array of Persistence-Capable objects transient
 void makeTransientAll(java.lang.Object[] pcs, boolean useFetchPlan)
          Make an array of Persistence-Capable objects transient
 java.lang.Object newInstance(java.lang.Class persistenceCapable)
          Method to create an instance of an interface or abstract class
 javax.jdo.Query newNamedQuery(java.lang.Class cls, java.lang.String queryName)
          Accessor for a new named query.
 java.lang.Object newObjectIdInstance(java.lang.Class pcClass, java.lang.Object key)
           
 java.lang.Object newObjectIdInstance(java.lang.Class clazz, java.lang.String str)
           
 javax.jdo.Query newQuery()
          Accessor for a new query.
 javax.jdo.Query newQuery(java.lang.Class cls)
          Accessor for a new query using this candidate class.
 javax.jdo.Query newQuery(java.lang.Class cls, java.util.Collection cln)
          Accessor for a new query.
 javax.jdo.Query newQuery(java.lang.Class cls, java.util.Collection cln, java.lang.String filter)
          Accessor for a new query.
 javax.jdo.Query newQuery(java.lang.Class cls, java.lang.String filter)
          Accessor for a new query.
 javax.jdo.Query newQuery(javax.jdo.Extent ext)
          Accessor for a new query based on the provided extent.
 javax.jdo.Query newQuery(javax.jdo.Extent cln, java.lang.String filter)
          Accessor for a new query.
 javax.jdo.Query newQuery(java.lang.Object obj)
          Accessor for a new query.
 javax.jdo.Query newQuery(java.lang.String query)
          Accessor for a single-string query.
 javax.jdo.Query newQuery(java.lang.String language, java.lang.Object query)
          Accessor for a new query in the specified query language etc.
 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 o)
          Method to refresh an object
 void refreshAll()
          Method to refresh all objects in the Persistence Manager.
 void refreshAll(java.util.Collection os)
          Method to refresh a collection of objects.
 void refreshAll(javax.jdo.JDOException exc)
          Method to refresh objects that failed verification in a JDOException
 void refreshAll(java.lang.Object[] os)
          Method to refresh an array of objects.
 void removeInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener)
          JDO 2.0 spec 12.15 "LifecycleListeners".
 java.lang.Object removeUserObject(java.lang.Object key)
          Method to remove a user object from the PersistenceManager.
 void retrieve(java.lang.Object o)
          Method to retrieve an object
 void retrieve(java.lang.Object o, boolean fgOnly)
          Method to retrieve an object
 void retrieveAll(boolean fgOnly, java.lang.Object[] pcs)
          Retrieve field values of instances from the store.
 void retrieveAll(java.util.Collection pcs)
          Retrieve a Collection of Persistence-Capable objects
 void retrieveAll(java.util.Collection pcs, boolean fgOnly)
          Retrieve field values of instances from the store.
 void retrieveAll(java.lang.Object[] pcs)
          Retrieve an array of Persistence-Capable objects
 void retrieveAll(java.lang.Object[] pcs, boolean fgOnly)
          Retrieve field values of instances from the store.
 void setCopyOnAttach(boolean flag)
           
 void setDetachAllOnCommit(boolean detach)
          Mutator for whether to detach all objects on commit of the txn.
 void setIgnoreCache(boolean ignore)
          Mutator for whether to ignore the cache or not
 void setMultithreaded(boolean multithreaded)
          Mutator for the multithreaded capability of the manager
 void setUserObject(java.lang.Object obj)
          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
 

Field Detail

LOCALISER

protected static final org.datanucleus.util.Localiser LOCALISER
Localisation utility for output messages

Constructor Detail

PersistenceManagerImpl

public PersistenceManagerImpl(ManagedConnectionImpl mc)
Constructor.

Parameters:
mc - The connection implementation.
Method Detail

getLocalTransaction

public javax.resource.cci.LocalTransaction getLocalTransaction()
                                                        throws javax.resource.ResourceException
Accessor for the local transaction.

Specified by:
getLocalTransaction in interface javax.resource.cci.Connection
Returns:
The local transaction
Throws:
javax.resource.ResourceException - Thrown when an error occurs

getMetaData

public javax.resource.cci.ConnectionMetaData getMetaData()
                                                  throws javax.resource.ResourceException
Accessor for Meta-Data.

Specified by:
getMetaData in interface javax.resource.cci.Connection
Returns:
The Connection Meta-Data.
Throws:
javax.resource.ResourceException -

createInteraction

public javax.resource.cci.Interaction createInteraction()
                                                 throws javax.resource.ResourceException
Specified by:
createInteraction in interface javax.resource.cci.Connection
Returns:
Throws:
javax.resource.ResourceException -

getResultSetInfo

public javax.resource.cci.ResultSetInfo getResultSetInfo()
                                                  throws javax.resource.ResourceException
Specified by:
getResultSetInfo in interface javax.resource.cci.Connection
Returns:
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:
close in interface javax.jdo.PersistenceManager
Specified by:
close in interface javax.resource.cci.Connection

isClosed

public boolean isClosed()
Accessor for whether the Persistence manager is closed.

Specified by:
isClosed in interface javax.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:
setDetachAllOnCommit in interface javax.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:
getDetachAllOnCommit in interface javax.jdo.PersistenceManager
Returns:
Whether to detach objects on commit of the txn.

refresh

public void refresh(java.lang.Object o)
Method to refresh an object

Specified by:
refresh in interface javax.jdo.PersistenceManager
Parameters:
o - Object to refresh

retrieve

public void retrieve(java.lang.Object o,
                     boolean fgOnly)
Method to retrieve an object

Specified by:
retrieve in interface javax.jdo.PersistenceManager
Parameters:
o - Object to retrieve
fgOnly - Whether to include only fields in current fetch group

retrieve

public void retrieve(java.lang.Object o)
Method to retrieve an object

Specified by:
retrieve in interface javax.jdo.PersistenceManager
Parameters:
o - Object to retrieve

retrieveAll

public void retrieveAll(java.util.Collection pcs)
Retrieve a Collection of Persistence-Capable objects

Specified by:
retrieveAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - Collection of Persistence-Capable objects

retrieveAll

public void retrieveAll(java.lang.Object[] pcs)
Retrieve an array of Persistence-Capable objects

Specified by:
retrieveAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - Array of Persistence-Capable objects

retrieveAll

public void retrieveAll(java.lang.Object[] pcs,
                        boolean fgOnly)
Retrieve field values of instances from the store. This tells the 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.

Specified by:
retrieveAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - the instances
fgOnly - whether to retrieve only the current fetch-group fields
Since:
JDO 1.0.1

retrieveAll

public void retrieveAll(boolean fgOnly,
                        java.lang.Object[] pcs)
Retrieve field values of instances from the store.

Specified by:
retrieveAll in interface javax.jdo.PersistenceManager
Parameters:
fgOnly - whether to retrieve only the current fetch-group fields
pcs - the instances
Since:
JDO 2.1

retrieveAll

public void retrieveAll(java.util.Collection pcs,
                        boolean fgOnly)
Retrieve field values of instances from the store. This tells the 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.

Specified by:
retrieveAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - the instances
fgOnly - 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:
currentTransaction in interface javax.jdo.PersistenceManager
Returns:
The current transaction

evict

public void evict(java.lang.Object o)
Method to evict an object

Specified by:
evict in interface javax.jdo.PersistenceManager
Parameters:
o - Object to evict

evictAll

public void evictAll(java.lang.Object[] os)
Method to evict an array of objects

Specified by:
evictAll in interface javax.jdo.PersistenceManager
Parameters:
os - Array of objects to evict

evictAll

public void evictAll(java.util.Collection os)
Method to evict all of the specified objects from the PM.

Specified by:
evictAll in interface javax.jdo.PersistenceManager
Parameters:
os - Collection of objects to evict

evictAll

public void evictAll(java.lang.Class cls,
                     boolean subclasses)
Method to evict all objects of the specified type (and optionaly its subclasses).

Parameters:
cls - Type of persistable object
subclasses - Whether to include subclasses

evictAll

public void evictAll(boolean subclasses,
                     java.lang.Class cls)
Method to evict all objects of the specified type (and optionaly its subclasses).

Specified by:
evictAll in interface javax.jdo.PersistenceManager
Parameters:
subclasses - Whether to include subclasses
cls - Type of persistable object

evictAll

public void evictAll()
Method to evict all objects from the PM.

Specified by:
evictAll in interface javax.jdo.PersistenceManager

refreshAll

public void refreshAll(java.lang.Object[] os)
Method to refresh an array of objects.

Specified by:
refreshAll in interface javax.jdo.PersistenceManager
Parameters:
os - Array of objects to refresh

refreshAll

public void refreshAll(java.util.Collection os)
Method to refresh a collection of objects.

Specified by:
refreshAll in interface javax.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:
refreshAll in interface javax.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:
refreshAll in interface javax.jdo.PersistenceManager

newQuery

public javax.jdo.Query newQuery()
Accessor for a new query.

Specified by:
newQuery in interface javax.jdo.PersistenceManager
Returns:
The query.

newQuery

public javax.jdo.Query newQuery(java.lang.Object obj)
Accessor for a new query.

Specified by:
newQuery in interface javax.jdo.PersistenceManager
Parameters:
obj - object
Returns:
The new query

newQuery

public javax.jdo.Query newQuery(java.lang.String query)
Accessor for a single-string query.

Specified by:
newQuery in interface javax.jdo.PersistenceManager
Parameters:
query - The single-string query
Returns:
The Query

newQuery

public javax.jdo.Query newQuery(java.lang.String language,
                                java.lang.Object query)
Accessor for a new query in the specified query language etc.

Specified by:
newQuery in interface javax.jdo.PersistenceManager
Parameters:
language - The query language
query - The query definition
Returns:
The new query

newQuery

public javax.jdo.Query newQuery(java.lang.Class cls)
Accessor for a new query using this candidate class.

Specified by:
newQuery in interface javax.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:
newQuery in interface javax.jdo.PersistenceManager
Parameters:
ext - The extent to use
Returns:
The new query

newQuery

public javax.jdo.Query newQuery(java.lang.Class cls,
                                java.util.Collection cln)
Accessor for a new query.

Specified by:
newQuery in interface javax.jdo.PersistenceManager
Parameters:
cls - The candidate class.
cln - The collection to use.
Returns:
The new query

newQuery

public javax.jdo.Query newQuery(java.lang.Class cls,
                                java.lang.String filter)
Accessor for a new query.

Specified by:
newQuery in interface javax.jdo.PersistenceManager
Parameters:
cls - The candidate class
filter - The filter to use
Returns:
The new query

newQuery

public javax.jdo.Query newQuery(java.lang.Class cls,
                                java.util.Collection cln,
                                java.lang.String filter)
Accessor for a new query.

Specified by:
newQuery in interface javax.jdo.PersistenceManager
Parameters:
cls - The candidate class
cln - The collection
filter - The filter to use
Returns:
The new query

newQuery

public javax.jdo.Query newQuery(javax.jdo.Extent cln,
                                java.lang.String filter)
Accessor for a new query.

Specified by:
newQuery in interface javax.jdo.PersistenceManager
Parameters:
cln - The collection
filter - The filter to use
Returns:
The new query

newNamedQuery

public javax.jdo.Query newNamedQuery(java.lang.Class cls,
                                     java.lang.String queryName)
Accessor for a new named query.

Specified by:
newNamedQuery in interface javax.jdo.PersistenceManager
Parameters:
cls - The candidate class
queryName - The name of the query
Returns:
The new query

getExtent

public javax.jdo.Extent getExtent(java.lang.Class cls,
                                  boolean subclasses)
Accessor for the extent of a candidate class.

Specified by:
getExtent in interface javax.jdo.PersistenceManager
Parameters:
cls - The candidate class
subclasses - Whether to include subclasses
Returns:
The extent for these classes

getExtent

public javax.jdo.Extent getExtent(java.lang.Class cls)
Accessor for the extent of a candidate class.

Specified by:
getExtent in interface javax.jdo.PersistenceManager
Parameters:
cls - The candidate class
Returns:
The extent for these classes
Since:
1.1

getFetchPlan

public javax.jdo.FetchPlan getFetchPlan()
Acessor for the current FetchPlan

Specified by:
getFetchPlan in interface javax.jdo.PersistenceManager
Returns:
FetchPlan
Since:
1.1

getObjectById

public java.lang.Object getObjectById(java.lang.Object id)
Accessor for an object given its id.

Specified by:
getObjectById in interface javax.jdo.PersistenceManager
Parameters:
id - Id of the object.
Returns:
The object with this id

getObjectById

public java.lang.Object getObjectById(java.lang.Object id,
                                      boolean validate)
Accessor for an object given its id.

Specified by:
getObjectById in interface javax.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 java.util.Collection getObjectsById(java.util.Collection oids)
Specified by:
getObjectsById in interface javax.jdo.PersistenceManager

getObjectsById

public java.lang.Object[] getObjectsById(java.lang.Object[] oids)
Specified by:
getObjectsById in interface javax.jdo.PersistenceManager

getObjectsById

public java.util.Collection getObjectsById(java.util.Collection oids,
                                           boolean validate)
Specified by:
getObjectsById in interface javax.jdo.PersistenceManager

getObjectsById

public java.lang.Object[] getObjectsById(java.lang.Object[] oids,
                                         boolean validate)
Specified by:
getObjectsById in interface javax.jdo.PersistenceManager

getObjectsById

public java.lang.Object[] getObjectsById(boolean validate,
                                         java.lang.Object[] oids)
Specified by:
getObjectsById in interface javax.jdo.PersistenceManager

getObjectById

public java.lang.Object getObjectById(java.lang.Class cls,
                                      java.lang.Object key)
Specified by:
getObjectById in interface javax.jdo.PersistenceManager

newObjectIdInstance

public java.lang.Object newObjectIdInstance(java.lang.Class pcClass,
                                            java.lang.Object key)
Specified by:
newObjectIdInstance in interface javax.jdo.PersistenceManager

getObjectId

public java.lang.Object getObjectId(java.lang.Object pc)
Accessor for the id of an object.

Specified by:
getObjectId in interface javax.jdo.PersistenceManager
Parameters:
pc - The object
Returns:
The objects id

getTransactionalObjectId

public java.lang.Object getTransactionalObjectId(java.lang.Object pc)
Specified by:
getTransactionalObjectId in interface javax.jdo.PersistenceManager
Parameters:
pc -
Returns:

newObjectIdInstance

public java.lang.Object newObjectIdInstance(java.lang.Class clazz,
                                            java.lang.String str)
Parameters:
clazz -
str -
Returns:

newInstance

public java.lang.Object newInstance(java.lang.Class persistenceCapable)
Method to create an instance of an interface or abstract class

Specified by:
newInstance in interface javax.jdo.PersistenceManager
Parameters:
persistenceCapable - interface/abstract class declared in metadata
Returns:
Instance of the interface / abstract class

makePersistent

public java.lang.Object makePersistent(java.lang.Object pc)
Method to make an object persistent.

Specified by:
makePersistent in interface javax.jdo.PersistenceManager
Parameters:
pc - The object to persist

makePersistentAll

public java.lang.Object[] makePersistentAll(java.lang.Object[] pcs)
Make an array of Persistent Capable objects persistent

Specified by:
makePersistentAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - Array of Persistent Capable objects

makePersistentAll

public java.util.Collection makePersistentAll(java.util.Collection pcs)
Make a Collection of Persistence Capable objects persistent

Specified by:
makePersistentAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - Collection of Persistence Capable objects

deletePersistent

public void deletePersistent(java.lang.Object pc)
JDO method to delete a Persistence Capable object

Specified by:
deletePersistent in interface javax.jdo.PersistenceManager
Parameters:
pc - Persistence Capable object

deletePersistentAll

public void deletePersistentAll(java.lang.Object[] pcs)
JDO method to delete an array of Persistence Capable objects

Specified by:
deletePersistentAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - Array of Persistence Capable objects

deletePersistentAll

public void deletePersistentAll(java.util.Collection pcs)
JDO method to delete a Collection of Persistence Capable objects

Specified by:
deletePersistentAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - Collection of Persistence Capable objects

makeTransient

public void makeTransient(java.lang.Object pc,
                          boolean useFetchPlan)
Make a Persistence-Capable object transient , optionally using the fetch plan.

Specified by:
makeTransient in interface javax.jdo.PersistenceManager
Parameters:
pc - Persistence-Capable object
useFetchPlan - Whether to use the fetch plan

makeTransientAll

public void makeTransientAll(java.lang.Object[] pcs,
                             boolean useFetchPlan)
Make an array of Persistence-Capable objects transient

Specified by:
makeTransientAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - Array of Persistence-Capable objects
useFetchPlan - Whether to use the fetch plan

makeTransientAll

public void makeTransientAll(boolean useFetchPlan,
                             java.lang.Object[] pcs)
Make an array of Persistence-Capable objects transient

Specified by:
makeTransientAll in interface javax.jdo.PersistenceManager
Parameters:
useFetchPlan - Whether to use the fetch plan
pcs - Array of Persistence-Capable objects
Since:
JDO 2.1

makeTransientAll

public void makeTransientAll(java.util.Collection pcs,
                             boolean useFetchPlan)
Make a Collection of Persistence-Capable objects transient

Specified by:
makeTransientAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - Collection of Persistence-Capable objects
useFetchPlan - Whether to use the fetch plan

makeTransient

public void makeTransient(java.lang.Object pc)
Make a Persistence-Capable object transient

Specified by:
makeTransient in interface javax.jdo.PersistenceManager
Parameters:
pc - Persistence-Capable object

makeTransientAll

public void makeTransientAll(java.lang.Object[] pcs)
Make an array of Persistence-Capable objects transient

Specified by:
makeTransientAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - Array of Persistence-Capable objects

makeTransientAll

public void makeTransientAll(java.util.Collection pcs)
Make a Collection of Persistence-Capable objects transient

Specified by:
makeTransientAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - Collection of Persistence-Capable objects

makeTransactional

public void makeTransactional(java.lang.Object pc)
Make a Persistence-Capable object transient

Specified by:
makeTransactional in interface javax.jdo.PersistenceManager
Parameters:
pc - Persistence-Capable object

makeTransactionalAll

public void makeTransactionalAll(java.lang.Object[] pcs)
Make an array of Persistence-Capable objects transactional

Specified by:
makeTransactionalAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - Array of Persistence-Capable objects

makeTransactionalAll

public void makeTransactionalAll(java.util.Collection pcs)
Make a collection of PersistenceCapable objects transactional

Specified by:
makeTransactionalAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - Collection of Persistence-Capable objects

makeNontransactional

public void makeNontransactional(java.lang.Object pc)
Make a Persistence-Capable object non-transactional

Specified by:
makeNontransactional in interface javax.jdo.PersistenceManager
Parameters:
pc - Persistence-Capable object

makeNontransactionalAll

public void makeNontransactionalAll(java.lang.Object[] pcs)
Make an array of Persistence-Capable objects non-transactional

Specified by:
makeNontransactionalAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - Array of Persistence-Capable objects

makeNontransactionalAll

public void makeNontransactionalAll(java.util.Collection pcs)
Make a Collection of Persistence-Capable objects non-transactional

Specified by:
makeNontransactionalAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - Collection of Persistence-Capable objects

detachCopy

public java.lang.Object detachCopy(java.lang.Object pc)
Detach the specified object from the PersistenceManager.

Specified by:
detachCopy in interface javax.jdo.PersistenceManager
Parameters:
pc - the instance to detach
Returns:
the detached instance
Since:
JDO 2.0
See Also:
detachCopyAll(Object[])

detachCopyAll

public java.lang.Object[] detachCopyAll(java.lang.Object[] pcs)
Detach the specified objects from the 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.

Specified by:
detachCopyAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - the instances to detach
Returns:
the detached instances
Throws:
javax.jdo.JDOUserException - if any of the instances do not
Since:
JDO 2.0
See Also:
makePersistentAll(Object[]), getFetchPlan()

detachCopyAll

public java.util.Collection detachCopyAll(java.util.Collection pcs)
Detach the specified objects from the PersistenceManager.

Specified by:
detachCopyAll in interface javax.jdo.PersistenceManager
Parameters:
pcs - the instances to detach
Returns:
the detached instances
Since:
JDO 2.0
See Also:
detachCopyAll(Object[])

putUserObject

public java.lang.Object putUserObject(java.lang.Object key,
                                      java.lang.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:
putUserObject in interface javax.jdo.PersistenceManager
Parameters:
key - The key to store the user object under
value - The object to store
Returns:
The previous value for this key
Since:
1.1

getUserObject

public java.lang.Object getUserObject(java.lang.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:
getUserObject in interface javax.jdo.PersistenceManager
Parameters:
key - The key to store the user object under
Returns:
The user object for that key
Since:
1.1

removeUserObject

public java.lang.Object removeUserObject(java.lang.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:
removeUserObject in interface javax.jdo.PersistenceManager
Parameters:
key - The key whose uder object is to be removed.
Returns:
The user object that was removed
Since:
1.1

setUserObject

public void setUserObject(java.lang.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:
setUserObject in interface javax.jdo.PersistenceManager
Parameters:
obj - User Object

getUserObject

public java.lang.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:
getUserObject in interface javax.jdo.PersistenceManager
Returns:
User object

getPersistenceManagerFactory

public javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory()
Retrieve the PersistenceManagerFactory for this manager

Specified by:
getPersistenceManagerFactory in interface javax.jdo.PersistenceManager
Returns:
The PersistenceManagerFactory

getObjectIdClass

public java.lang.Class getObjectIdClass(java.lang.Class clazz)
Retrieve the class for the objectid

Specified by:
getObjectIdClass in interface javax.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:
setMultithreaded in interface javax.jdo.PersistenceManager
Parameters:
multithreaded - Whether to run multithreaded or not

getMultithreaded

public boolean getMultithreaded()
Accessor for the multithreaded capability of the manager

Specified by:
getMultithreaded in interface javax.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:
setIgnoreCache in interface javax.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:
getIgnoreCache in interface javax.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:
flush in interface javax.jdo.PersistenceManager

checkConsistency

public void checkConsistency()
Method to check the consistency of the cache.

Specified by:
checkConsistency in interface javax.jdo.PersistenceManager

getDataStoreConnection

public javax.jdo.datastore.JDOConnection getDataStoreConnection()
(non-Javadoc)

Specified by:
getDataStoreConnection in interface javax.jdo.PersistenceManager
Since:
1.1
See Also:
PersistenceManager.getDataStoreConnection()

getSequence

public javax.jdo.datastore.Sequence getSequence(java.lang.String sequenceName)
Accessor for a Sequence.

Specified by:
getSequence in interface javax.jdo.PersistenceManager
Parameters:
sequenceName - Name of the sequence
Returns:
The sequence

addInstanceLifecycleListener

public void addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener,
                                         java.lang.Class[] classes)
JDO 2.0 spec 12.15 "LifecycleListeners".

Specified by:
addInstanceLifecycleListener in interface javax.jdo.PersistenceManager
Parameters:
listener - The instance lifecycle listener to sends events to
classes - 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:
removeInstanceLifecycleListener in interface javax.jdo.PersistenceManager
Parameters:
listener - The instance lifecycle listener to remove.
Since:
1.1

getServerDate

public java.util.Date getServerDate()
Accessor for the server date/time.

Specified by:
getServerDate in interface javax.jdo.PersistenceManager
Returns:
The server date/time

getCopyOnAttach

public boolean getCopyOnAttach()
Specified by:
getCopyOnAttach in interface javax.jdo.PersistenceManager

setCopyOnAttach

public void setCopyOnAttach(boolean flag)
Specified by:
setCopyOnAttach in interface javax.jdo.PersistenceManager

getManagedObjects

public java.util.Set getManagedObjects()
Specified by:
getManagedObjects in interface javax.jdo.PersistenceManager

getManagedObjects

public java.util.Set getManagedObjects(java.lang.Class[] classes)
Specified by:
getManagedObjects in interface javax.jdo.PersistenceManager

getManagedObjects

public java.util.Set getManagedObjects(java.util.EnumSet states)
Specified by:
getManagedObjects in interface javax.jdo.PersistenceManager

getManagedObjects

public java.util.Set getManagedObjects(java.util.EnumSet states,
                                       java.lang.Class[] classes)
Specified by:
getManagedObjects in interface javax.jdo.PersistenceManager

getFetchGroup

public javax.jdo.FetchGroup getFetchGroup(java.lang.Class cls,
                                          java.lang.String name)
Specified by:
getFetchGroup in interface javax.jdo.PersistenceManager


Copyright © 2009. All Rights Reserved.