org.datanucleus
Interface ObjectManager

All Known Implementing Classes:
ObjectManagerImpl

public interface ObjectManager

Definition of an ObjectManager. Provides the basics of object persistence internally, upon which are built javax.jdo.PersistenceManager and javax.persistence.EntityManager.


Nested Class Summary
static interface ObjectManager.ObjectManagerListener
          Listener of ObjectManager events
 
Method Summary
 void addInternalFetchGroup(FetchGroup grp)
          Method to add an internal fetch group to this ObjectManager.
 void addListener(java.lang.Object listener, java.lang.Class[] classes)
          Method to register a listener for instances of the specified classes.
 void addStateManager(StateManager sm)
          Method to add the object managed by the specified StateManager to the cache.
 void assertClassPersistable(java.lang.Class cls)
          Convenience method to assert if the passed class is not persistable.
 void attachObject(java.lang.Object pc, boolean sco)
          Method to attach the passed object (and related objects).
 java.lang.Object attachObjectCopy(java.lang.Object pc, boolean sco)
          Method to attach a copy of the passed object (and related objects).
 void clearDirty()
          Method to mark as clean all StateManagers of dirty objects.
 void clearDirty(StateManager sm)
          Mark the specified StateManager as clean.
 void close()
          Method to close the ObjectManager.
 void deleteObject(java.lang.Object obj)
          Method to delete an object from the datastore.
 void deleteObjectInternal(java.lang.Object pc)
          Method to delete the passed object (internally).
 void deleteObjects(java.util.Collection objs)
          Method to delete a collection of objects from the datastore.
 void deleteObjects(java.lang.Object[] objs)
          Method to delete an array of objects from the datastore.
 void detachAll()
          Method to detach all objects in the PM.
 void detachObject(java.lang.Object pc, FetchPlanState state)
          Method to detach the passed object.
 java.lang.Object detachObjectCopy(java.lang.Object pc, FetchPlanState state)
          Method to detach a copy of the passed object using the provided state.
 void disconnectLifecycleListener()
          Disconnect the registered LifecycleListener
 void disconnectSMCache()
          Disconnect SM instances, clear cache and reset settings
 void enlistInTransaction(StateManager sm)
          Method to enlist the specified StateManager in the current transaction.
 void evictAllObjects()
          Method to evict all L1 cache objects
 void evictFromTransaction(StateManager sm)
          Method to evict the specified StateManager from the current transaction.
 void evictObject(java.lang.Object pc)
          Method to evict the passed object.
 void evictObjects(java.lang.Class cls, boolean subclasses)
          Method to evict all objects of the specified type (and optionaly its subclasses).
 boolean exists(java.lang.Object obj)
          Method to return if the specified object exists in the datastore.
 java.lang.Object findObject(java.lang.Object id, boolean validate, boolean checkInheritance, java.lang.String objectClassName)
          Accessor for an object given the object id.
 java.lang.Object findObject(java.lang.Object id, FieldValues fv)
          Accessor for an object given the object id.
 java.lang.Object findObject(java.lang.Object id, FieldValues fv, java.lang.Class pcClass, boolean ignoreCache)
          Accessor for an object given the object id.
 java.lang.Object findObjectUsingAID(java.lang.Class pcClass, FieldValues fv, boolean ignoreCache, boolean checkInheritance)
          Accessor for an object given the object id.
 StateManager findStateManager(java.lang.Object pc)
          Method to find the StateManager for the passed persistable object when it is managed by this manager.
 void flush()
          Method callable from external APIs for user-management of flushing.
 void flushInternal(boolean flushToDatastore)
          Method to flushes all dirty, new, and deleted instances to the datastore.
 ApiAdapter getApiAdapter()
          Accessor for the API adapter.
 CallbackHandler getCallbackHandler()
          Retrieve the callback handler for this PM
 ClassLoaderResolver getClassLoaderResolver()
          Accessor for the ClassLoader resolver to use in class loading issues.
 boolean getCopyOnAttach()
          Accessor for whether the ObjectManager should copy on attaching.
 boolean getDetachAllOnCommit()
          Accessor for whether the ObjectManager will detach all objects on commit
 Extent getExtent(java.lang.Class candidateClass, boolean includeSubclasses)
          Accessor for the Extent for a class (and optionally its subclasses).
 java.util.Set getFetchGroupsWithName(java.lang.String name)
          Accessor for the fetch groups for the specified name.
 FetchPlan getFetchPlan()
          Acessor for the current FetchPlan
 boolean getIgnoreCache()
          Accessor for whether to ignore the cache.
 FetchGroup getInternalFetchGroup(java.lang.Class cls, java.lang.String name)
          Accessor for an internal fetch group for the specified class.
 java.util.Set getManagedObjects()
          Accessor for the currently managed objects for the current transaction.
 java.util.Set getManagedObjects(java.lang.Class[] classes)
          Accessor for the currently managed objects for the current transaction.
 java.util.Set getManagedObjects(java.lang.String[] states)
          Accessor for the currently managed objects for the current transaction.
 java.util.Set getManagedObjects(java.lang.String[] states, java.lang.Class[] classes)
          Accessor for the currently managed objects for the current transaction.
 MetaDataManager getMetaDataManager()
          Accessor for the MetaData Manager.
 boolean getMultithreaded()
          Accessor for whether the ObjectManager is multithreaded
 java.lang.Object getObjectFromCache(java.lang.Object id)
          Convenience method to access an object in the cache.
 ObjectManagerFactoryImpl getObjectManagerFactory()
          Accessor for the ObjectManagerFactory to which this manager belongs.
 OMFContext getOMFContext()
          Accessor for the context in which this ObjectManager is running.
 java.lang.Object getOwner()
          Method to return the owner object.
 StateManager getStateManagerById(java.lang.Object myID)
          Accessor for the StateManager of an object given the object id.
 StoreManager getStoreManager()
          Accessor for the Store Manager.
 Transaction getTransaction()
          Accessor for the current transaction for this ObjectManager.
 boolean hasPersistenceInformationForClass(java.lang.Class cls)
          Utility method to check if the specified class has reachable metadata or annotations.
 void hereIsStateManager(StateManager sm, java.lang.Object pc)
          Method to register the StateManager as being for the passed object.
 boolean isClosed()
          Accessor for whether this ObjectManager is closed.
 boolean isDelayDatastoreOperationsEnabled()
          Whether the datastore operations are delayed until commit.
 boolean isEnlistedInTransaction(java.lang.Object id)
          Method to return if an object is enlisted in the current transaction.
 boolean isFlushing()
          Accessor for whether the ObjectManager is flushing changes to the datastore.
 boolean isInserting(java.lang.Object pc)
          Tests whether this persistable object is being inserted.
 boolean isManagingRelations()
          Returns whether this ObjectManager is currently performing the manage relationships task.
 boolean isRunningDetachAllOnCommit()
          Accessor for whether this ObjectManager is currently running detachAllOnCommit.
 void makeObjectNontransactional(java.lang.Object pc)
          Method to make the passed object nontransactional.
 void makeObjectTransactional(java.lang.Object pc)
          Method to make the passed object transactional.
 void makeObjectTransient(java.lang.Object pc, FetchPlanState state)
          Method to make transient the passed object.
 void markDirty(StateManager sm, boolean directUpdate)
          Mark the specified StateManager as dirty
 void markManagedRelationDirty(StateManager sm)
          Method to mark the specified StateManager as needing an update due to managed relation constraints.
 java.lang.Object newInstance(java.lang.Class persistenceCapable)
          Method to generate an instance of an interface, abstract class, or concrete PC class.
 java.lang.Object newObjectId(java.lang.Class pcClass, java.lang.Object key)
          This method returns an object id instance corresponding to the pcClass and key arguments.
 java.lang.Object newObjectId(java.lang.String className, java.lang.Object pc)
          This method returns an object id instance corresponding to the class name, and the passed object (when using app identity).
 Query newQuery()
          Accessor for a new Query.
 java.lang.Object persistObject(java.lang.Object pc)
          Method to persist the passed object.
 java.lang.Object persistObjectInternal(java.lang.Object pc, FieldValues preInsertChanges, StateManager ownerSM, int ownerFieldNum, int objectType)
          Method to persist the passed object (internally).
 void postBegin()
          Method called during the begin process, after the actual begin.
 void postClose()
          Method called during the close process.
 void postCommit()
          Method called during the commit process, after the actual datastore commit.
 void preCommit()
          Method called during the commit process, before the actual datastore commit.
 void preRollback()
          Method called during the rollback process, after the actual datastore rollback.
 void putObjectIntoCache(StateManager sm)
          Method to put a Persistable object associated to the StateManager into the L1 cache.
 void refreshAllObjects()
          Method to refresh all L1 cache objects
 void refreshObject(java.lang.Object pc)
          Method to refresh the passed object.
 void removeListener(java.lang.Object listener)
          Method to remove a currently registered listener.
 void removeObjectFromCache(java.lang.Object pc, java.lang.Object id)
          Method to remove an object from the L1 cache.
 void removeStateManager(StateManager sm)
          Method to remove the object managed by the specified StateManager from the cache.
 void replaceObjectId(java.lang.Object pc, java.lang.Object oldID, java.lang.Object newID)
          Replace the previous object id for a PC object to a new
 void retrieveObject(java.lang.Object pc, boolean fgOnly)
          Method to retrieve the passed object.
 void setCopyOnAttach(boolean flag)
          Method whether to copy on attaching.
 void setDetachAllOnCommit(boolean flag)
          Method to set DetachAllOnCommit.
 void setDetachOnClose(boolean flag)
          Method to set DetachOnClose.
 void setIgnoreCache(boolean ignore)
          Method to set whether to ignore the L1 cache.
 void setMultithreaded(boolean multi)
          Method to set whether the ObjectManager should operate multithreaded
 

Method Detail

getOwner

java.lang.Object getOwner()
Method to return the owner object. For JDO this will return the PersistenceManager owning this ObjectManager. For JPA this will return the EntityManager owning this ObjectManager.

Returns:
The owner manager object

close

void close()
Method to close the ObjectManager.


isClosed

boolean isClosed()
Accessor for whether this ObjectManager is closed.

Returns:
Whether this manager is closed.

getTransaction

Transaction getTransaction()
Accessor for the current transaction for this ObjectManager.

Returns:
The current transaction

getStoreManager

StoreManager getStoreManager()
Accessor for the Store Manager.

Returns:
Store Manager

getMetaDataManager

MetaDataManager getMetaDataManager()
Accessor for the MetaData Manager.

Returns:
The MetaData Manager

getOMFContext

OMFContext getOMFContext()
Accessor for the context in which this ObjectManager is running.

Returns:
Returns the context.

getObjectManagerFactory

ObjectManagerFactoryImpl getObjectManagerFactory()
Accessor for the ObjectManagerFactory to which this manager belongs.

Returns:
The OMF

getApiAdapter

ApiAdapter getApiAdapter()
Accessor for the API adapter.

Returns:
API adapter.

getFetchPlan

FetchPlan getFetchPlan()
Acessor for the current FetchPlan

Returns:
FetchPlan

getIgnoreCache

boolean getIgnoreCache()
Accessor for whether to ignore the cache.

Returns:
Whether to ignore the cache.

getDetachAllOnCommit

boolean getDetachAllOnCommit()
Accessor for whether the ObjectManager will detach all objects on commit

Returns:
Whether we detach all on commit

getCopyOnAttach

boolean getCopyOnAttach()
Accessor for whether the ObjectManager should copy on attaching.

Returns:
Whether we copy on attaching

getMultithreaded

boolean getMultithreaded()
Accessor for whether the ObjectManager is multithreaded

Returns:
Whether the ObjectManager is multithreaded

setDetachAllOnCommit

void setDetachAllOnCommit(boolean flag)
Method to set DetachAllOnCommit.

Parameters:
flag - Whether to detach all objects on commit of the transaction.

setCopyOnAttach

void setCopyOnAttach(boolean flag)
Method whether to copy on attaching.

Parameters:
flag - Whether to copy on attaching.

setIgnoreCache

void setIgnoreCache(boolean ignore)
Method to set whether to ignore the L1 cache.

Parameters:
ignore - Whether to ignore the L1 cache

setMultithreaded

void setMultithreaded(boolean multi)
Method to set whether the ObjectManager should operate multithreaded

Parameters:
multi - Whether to operate multithreaded

setDetachOnClose

void setDetachOnClose(boolean flag)
Method to set DetachOnClose.

Parameters:
flag - Whether to detach all objects on close of the ObjectManager.

getClassLoaderResolver

ClassLoaderResolver getClassLoaderResolver()
Accessor for the ClassLoader resolver to use in class loading issues.

Returns:
The ClassLoader resolver

getCallbackHandler

CallbackHandler getCallbackHandler()
Retrieve the callback handler for this PM

Returns:
the callback handler

assertClassPersistable

void assertClassPersistable(java.lang.Class cls)
Convenience method to assert if the passed class is not persistable.

Parameters:
cls - The class of which we want to persist objects
Throws:
ClassNotPersistableException - When the class is not persistable
NoPersistenceInformationException - When the class has no available persistence information

hasPersistenceInformationForClass

boolean hasPersistenceInformationForClass(java.lang.Class cls)
Utility method to check if the specified class has reachable metadata or annotations.

Parameters:
cls - The class to check
Returns:
Whether the class has reachable metadata or annotations

evictObject

void evictObject(java.lang.Object pc)
Method to evict the passed object.

Parameters:
pc - The object

evictObjects

void evictObjects(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

evictAllObjects

void evictAllObjects()
Method to evict all L1 cache objects


refreshObject

void refreshObject(java.lang.Object pc)
Method to refresh the passed object.

Parameters:
pc - The object

refreshAllObjects

void refreshAllObjects()
Method to refresh all L1 cache objects


retrieveObject

void retrieveObject(java.lang.Object pc,
                    boolean fgOnly)
Method to retrieve the passed object.

Parameters:
pc - The object
fgOnly - Just retrieve the current fetch group

persistObject

java.lang.Object persistObject(java.lang.Object pc)
Method to persist the passed object.

Parameters:
pc - The object
Returns:
The persisted object

persistObjectInternal

java.lang.Object persistObjectInternal(java.lang.Object pc,
                                       FieldValues preInsertChanges,
                                       StateManager ownerSM,
                                       int ownerFieldNum,
                                       int objectType)
Method to persist the passed object (internally).

Parameters:
pc - The object
preInsertChanges - Changes to be made before inserting
ownerSM - StateManager of the owner when embedded
ownerFieldNum - Field number in the owner where this is embedded (or -1 if not embedded)
objectType - Type of object (see org.datanucleus.StateManager, e.g StateManager.PC)
Returns:
The persisted object

makeObjectTransient

void makeObjectTransient(java.lang.Object pc,
                         FetchPlanState state)
Method to make transient the passed object.

Parameters:
pc - The object
state - Object containing the state of the fetchplan processing

makeObjectTransactional

void makeObjectTransactional(java.lang.Object pc)
Method to make the passed object transactional.

Parameters:
pc - The object

makeObjectNontransactional

void makeObjectNontransactional(java.lang.Object pc)
Method to make the passed object nontransactional.

Parameters:
pc - The object

deleteObject

void deleteObject(java.lang.Object obj)
Method to delete an object from the datastore.

Parameters:
obj - The object

deleteObjectInternal

void deleteObjectInternal(java.lang.Object pc)
Method to delete the passed object (internally).

Parameters:
pc - The object

deleteObjects

void deleteObjects(java.lang.Object[] objs)
Method to delete an array of objects from the datastore.

Parameters:
objs - The objects to delete

deleteObjects

void deleteObjects(java.util.Collection objs)
Method to delete a collection of objects from the datastore.

Parameters:
objs - The objects to delete

attachObject

void attachObject(java.lang.Object pc,
                  boolean sco)
Method to attach the passed object (and related objects). Throws an exception if another (persistent) object with the same id exists in the L1 cache already.

Parameters:
pc - The (detached) object
sco - Whether the object has no identity (embedded or serialised)

attachObjectCopy

java.lang.Object attachObjectCopy(java.lang.Object pc,
                                  boolean sco)
Method to attach a copy of the passed object (and related objects).

Parameters:
pc - The object
sco - Whether it has no identity (second-class object)
Returns:
The attached copy of the input object

detachObject

void detachObject(java.lang.Object pc,
                  FetchPlanState state)
Method to detach the passed object.

Parameters:
pc - The object to detach
state - State for the detachment process.

detachObjectCopy

java.lang.Object detachObjectCopy(java.lang.Object pc,
                                  FetchPlanState state)
Method to detach a copy of the passed object using the provided state.

Parameters:
pc - The object
state - State for the detachment process
Returns:
The detached copy of the object

detachAll

void detachAll()
Method to detach all objects in the PM.


exists

boolean exists(java.lang.Object obj)
Method to return if the specified object exists in the datastore.

Parameters:
obj - The (persistable) object
Returns:
Whether it exists

getManagedObjects

java.util.Set getManagedObjects()
Accessor for the currently managed objects for the current transaction. If the transaction is not active this returns null.

Returns:
Collection of managed objects enlisted in the current transaction

getManagedObjects

java.util.Set getManagedObjects(java.lang.Class[] classes)
Accessor for the currently managed objects for the current transaction. If the transaction is not active this returns null.

Parameters:
classes - Classes that we want the objects for
Returns:
Collection of managed objects enlisted in the current transaction

getManagedObjects

java.util.Set getManagedObjects(java.lang.String[] states)
Accessor for the currently managed objects for the current transaction. If the transaction is not active this returns null.

Parameters:
states - States that we want the objects for
Returns:
Collection of managed objects enlisted in the current transaction

getManagedObjects

java.util.Set getManagedObjects(java.lang.String[] states,
                                java.lang.Class[] classes)
Accessor for the currently managed objects for the current transaction. If the transaction is not active this returns null.

Parameters:
states - States that we want the objects for
classes - Classes that we want the objects for
Returns:
Collection of managed objects enlisted in the current transaction

findObject

java.lang.Object findObject(java.lang.Object id,
                            FieldValues fv)
Accessor for an object given the object id.

Parameters:
id - Id of the object.
fv - the FieldValues
Returns:
the Object

findObject

java.lang.Object findObject(java.lang.Object id,
                            boolean validate,
                            boolean checkInheritance,
                            java.lang.String objectClassName)
Accessor for an object given the object id.

Parameters:
id - Id of the object.
validate - Whether to validate the object state
checkInheritance - 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.
objectClassName - Class name for the object with this id (if known, optional)
Returns:
The Object

findObject

java.lang.Object findObject(java.lang.Object id,
                            FieldValues fv,
                            java.lang.Class pcClass,
                            boolean ignoreCache)
Accessor for an object given the object id.

Parameters:
id - Id of the object.
fv - the FieldValues
pcClass - the type which the object is. This type will be used to instanciat the object
ignoreCache - true if the cache is ignored
Returns:
the Object

findObjectUsingAID

java.lang.Object findObjectUsingAID(java.lang.Class pcClass,
                                    FieldValues fv,
                                    boolean ignoreCache,
                                    boolean checkInheritance)
Accessor for an object given the object id. The object uses application identity

Parameters:
fv - the FieldValues containing at minimum the primary key fields
pcClass - the type which the object is
ignoreCache - true if the cache is ignored
checkInheritance - true if the cache is ignored
Returns:
the Object

newObjectId

java.lang.Object newObjectId(java.lang.Class pcClass,
                             java.lang.Object key)
This method returns an object id instance corresponding to the pcClass and key arguments. Operates in 2 modes :-

Parameters:
pcClass - Class of the PersistenceCapable to create the identity for
key - Value of the key for SingleFieldIdentity (or the toString value)
Returns:
The new object-id instance

newObjectId

java.lang.Object newObjectId(java.lang.String className,
                             java.lang.Object pc)
This method returns an object id instance corresponding to the class name, and the passed object (when using app identity).

Parameters:
className - Name of the class of the object.
pc - The persistable object. Used for application-identity
Returns:
A new object ID.

newInstance

java.lang.Object newInstance(java.lang.Class persistenceCapable)
Method to generate an instance of an interface, abstract class, or concrete PC class.

Parameters:
persistenceCapable - The class of the interface or abstract class, or concrete class defined in MetaData
Returns:
The instance of this type

enlistInTransaction

void enlistInTransaction(StateManager sm)
Method to enlist the specified StateManager in the current transaction.

Parameters:
sm - The StateManager

evictFromTransaction

void evictFromTransaction(StateManager sm)
Method to evict the specified StateManager from the current transaction.

Parameters:
sm - The StateManager

isEnlistedInTransaction

boolean isEnlistedInTransaction(java.lang.Object id)
Method to return if an object is enlisted in the current transaction.

Parameters:
id - Identity for the object
Returns:
Whether it is enlisted in the current transaction

findStateManager

StateManager findStateManager(java.lang.Object pc)
Method to find the StateManager for the passed persistable object when it is managed by this manager.

Parameters:
pc - The persistable object
Returns:
The StateManager

hereIsStateManager

void hereIsStateManager(StateManager sm,
                        java.lang.Object pc)
Method to register the StateManager as being for the passed object. Used during the process of identifying StateManager for persistable object.

Parameters:
sm - The StateManager
pc - The object managed by the StateManager

addStateManager

void addStateManager(StateManager sm)
Method to add the object managed by the specified StateManager to the cache.

Parameters:
sm - The StateManager

removeStateManager

void removeStateManager(StateManager sm)
Method to remove the object managed by the specified StateManager from the cache.

Parameters:
sm - The StateManager

getStateManagerById

StateManager getStateManagerById(java.lang.Object myID)
Accessor for the StateManager of an object given the object id.

Parameters:
myID - Id of the object.
Returns:
The StateManager

markDirty

void markDirty(StateManager sm,
               boolean directUpdate)
Mark the specified StateManager as dirty

Parameters:
sm - The StateManager
directUpdate - Whether the object has had a direct update made on it (if known)

clearDirty

void clearDirty(StateManager sm)
Mark the specified StateManager as clean.

Parameters:
sm - The StateManager

clearDirty

void clearDirty()
Method to mark as clean all StateManagers of dirty objects.


markManagedRelationDirty

void markManagedRelationDirty(StateManager sm)
Method to mark the specified StateManager as needing an update due to managed relation constraints.

Parameters:
sm - The StateManager

isManagingRelations

boolean isManagingRelations()
Returns whether this ObjectManager is currently performing the manage relationships task.

Returns:
Whether in the process of managing relations

isInserting

boolean isInserting(java.lang.Object pc)
Tests whether this persistable object is being inserted.

Parameters:
pc - the object to verify the status
Returns:
true if this instance is inserting.

isDelayDatastoreOperationsEnabled

boolean isDelayDatastoreOperationsEnabled()
Whether the datastore operations are delayed until commit. In optimistic transactions this is automatically enabled.

Returns:
true if datastore operations are delayed until commit

preRollback

void preRollback()
Method called during the rollback process, after the actual datastore rollback.


postBegin

void postBegin()
Method called during the begin process, after the actual begin.


preCommit

void preCommit()
Method called during the commit process, before the actual datastore commit.


postCommit

void postCommit()
Method called during the commit process, after the actual datastore commit.


postClose

void postClose()
Method called during the close process.


flush

void flush()
Method callable from external APIs for user-management of flushing. Called by JDO PM.flush, or JPA EM.flush(). Performs management of relations, prior to performing internal flush of all dirty/new/deleted instances to the datastore.


flushInternal

void flushInternal(boolean flushToDatastore)
Method to 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.

Parameters:
flushToDatastore - Whether to ensure any changes reach the datastore Otherwise they will be flushed to the datastore manager and leave it to decide the opportune moment to actually flush them to teh datastore
Throws:
NucleusOptimisticException - when optimistic locking error(s) occur

isFlushing

boolean isFlushing()
Accessor for whether the ObjectManager is flushing changes to the datastore.

Returns:
Whether it is currently flushing

isRunningDetachAllOnCommit

boolean isRunningDetachAllOnCommit()
Accessor for whether this ObjectManager is currently running detachAllOnCommit.

Returns:
Whether running detachAllOnCommit

newQuery

Query newQuery()
Accessor for a new Query.

Returns:
The new Query

getExtent

Extent getExtent(java.lang.Class candidateClass,
                 boolean includeSubclasses)
Accessor for the Extent for a class (and optionally its subclasses).

Parameters:
candidateClass - The class
includeSubclasses - Whether to include subclasses
Returns:
The Extent

replaceObjectId

void replaceObjectId(java.lang.Object pc,
                     java.lang.Object oldID,
                     java.lang.Object newID)
Replace the previous object id for a PC object to a new

Parameters:
pc - The Persistable object
oldID - the old id
newID - the new id

putObjectIntoCache

void putObjectIntoCache(StateManager sm)
Method to put a Persistable object associated to the StateManager into the L1 cache.

Parameters:
sm - The State Manager

removeObjectFromCache

void removeObjectFromCache(java.lang.Object pc,
                           java.lang.Object id)
Method to remove an object from the L1 cache.

Parameters:
pc - The object
id - The id of the object

getObjectFromCache

java.lang.Object getObjectFromCache(java.lang.Object id)
Convenience method to access an object in the cache. Firstly looks in the L1 cache for this PM, and if not found looks in the L2 cache.

Parameters:
id - Id of the object
Returns:
Persistable object (with connected StateManager).

disconnectSMCache

void disconnectSMCache()
Disconnect SM instances, clear cache and reset settings


addListener

void addListener(java.lang.Object listener,
                 java.lang.Class[] classes)
Method to register a listener for instances of the specified classes.

Parameters:
listener - The listener to sends events to
classes - The classes that it is interested in

removeListener

void removeListener(java.lang.Object listener)
Method to remove a currently registered listener.

Parameters:
listener - The instance lifecycle listener to remove.

disconnectLifecycleListener

void disconnectLifecycleListener()
Disconnect the registered LifecycleListener


getInternalFetchGroup

FetchGroup getInternalFetchGroup(java.lang.Class cls,
                                 java.lang.String name)
Accessor for an internal fetch group for the specified class.

Parameters:
cls - The class
name - Name of the group
Returns:
The FetchGroup

addInternalFetchGroup

void addInternalFetchGroup(FetchGroup grp)
Method to add an internal fetch group to this ObjectManager.

Parameters:
grp - The internal fetch group

getFetchGroupsWithName

java.util.Set getFetchGroupsWithName(java.lang.String name)
Accessor for the fetch groups for the specified name.

Parameters:
name - Name of the group
Returns:
The FetchGroup


Copyright © 2009. All Rights Reserved.