public interface ExecutionContext
An ExecutionContext can be started with a series of options that affect its behaviour thereafter. These are defined by the "OPTION_{YYY}" static Strings.
Modifier and Type | Interface and Description |
---|---|
static class |
ExecutionContext.EmbeddedOwnerRelation |
static interface |
ExecutionContext.LifecycleListener |
Modifier and Type | Field and Description |
---|---|
static String |
OPTION_JTA_AUTOJOIN
Startup option setting whether, when using JTA, to do auto-join of transactions.
|
static String |
OPTION_PASSWORD
Startup option overriding the default (PMF/EMF) password for the connectionURL.
|
static String |
OPTION_USERNAME
Startup option overriding the default (PMF/EMF) username for the connectionURL.
|
Modifier and Type | Method and Description |
---|---|
void |
addInternalFetchGroup(FetchGroup grp)
Method to add an internal fetch group to this ExecutionContext.
|
void |
addListener(Object listener,
Class[] classes)
Method to register a listener for instances of the specified classes.
|
void |
addObjectProvider(ObjectProvider op)
Method to add the object managed by the specified ObjectProvider to the cache.
|
void |
addOperationToQueue(Operation oper)
Method to add an operation to the queue.
|
void |
assertClassPersistable(Class cls)
Convenience method to assert if the passed class is not persistable.
|
void |
attachObject(ObjectProvider op,
Object pc,
boolean sco)
Method to attach the passed object (and related objects).
|
Object |
attachObjectCopy(ObjectProvider op,
Object pc,
boolean sco)
Method to attach a copy of the passed object (and related objects).
|
void |
clearDirty()
Method to mark as clean all ObjectProviders of dirty objects.
|
void |
clearDirty(ObjectProvider op)
Mark the specified ObjectProvider as clean.
|
void |
close()
Method to close the execution context.
|
boolean |
containsObjectProviderAssociatedValue(ObjectProvider op,
Object key) |
void |
deleteObject(Object obj)
Method to delete an object from the datastore.
|
void |
deleteObjectInternal(Object pc)
Method to delete the passed object (internally).
|
void |
deleteObjects(Object[] objs)
Method to delete an array of objects from the datastore.
|
void |
deregisterEmbeddedRelation(ExecutionContext.EmbeddedOwnerRelation rel)
Method to deregister the specified embedded relation (e.g when the embedded object is disconnected).
|
void |
detachAll()
Method to detach all managed objects.
|
void |
detachObject(Object pc,
FetchPlanState state)
Method to detach the passed object.
|
Object |
detachObjectCopy(Object pc,
FetchPlanState state)
Method to detach a copy of the passed object using the provided state.
|
void |
disconnectLifecycleListener()
Disconnect the registered LifecycleListener
|
void |
enlistInTransaction(ObjectProvider op)
Method to enlist the specified ObjectProvider in the current transaction.
|
void |
evictAllObjects()
Method to evict all L1 cache objects
|
void |
evictFromTransaction(ObjectProvider op)
Method to evict the specified ObjectProvider from the current transaction.
|
void |
evictObject(Object pc)
Method to evict the passed object.
|
void |
evictObjects(Class cls,
boolean subclasses)
Method to evict all objects of the specified type (and optionaly its subclasses).
|
boolean |
exists(Object obj)
Method to return if the specified object exists in the datastore.
|
Object |
findObject(Object id,
boolean validate,
boolean checkInheritance,
String objectClassName)
Accessor for an object given the object id.
|
Object |
findObject(Object id,
FieldValues fv,
Class pcClass,
boolean ignoreCache,
boolean checkInheritance)
Accessor for an object given the object id.
|
ObjectProvider |
findObjectProvider(Object pc)
Method to find the ObjectProvider for the passed persistable object when it is managed by this manager.
|
ObjectProvider |
findObjectProvider(Object pc,
boolean persist)
Method to find the ObjectProvider for the passed persistable object when it is managed by this manager,
and if not yet persistent to persist it.
|
ObjectProvider |
findObjectProviderForEmbedded(Object value,
ObjectProvider owner,
AbstractMemberMetaData mmd)
Method to find the ObjectProvider for the passed embedded persistable object.
|
ObjectProvider |
findObjectProviderOfOwnerForAttachingObject(Object pc) |
Object[] |
findObjects(Object[] ids,
boolean validate)
Accessor for objects with the specified identities.
|
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.
|
void |
flushOperationsForBackingStore(Store backingStore,
ObjectProvider op)
Method to flush all queued operations for the specified backing store (if any).
|
ApiAdapter |
getApiAdapter()
Accessor for the API adapter.
|
Object |
getAttachDetachReferencedObject(ObjectProvider op)
Access a referenced object for this ObjectProvider during the attach/detach process.
|
Object |
getAttachedObjectForId(Object id)
Convenience method to return the attached object for the specified id if one exists.
|
Boolean |
getBooleanProperty(String name)
Accessor for a boolean property value.
|
CallbackHandler |
getCallbackHandler()
Retrieve the callback handler for this PM
|
ClassLoaderResolver |
getClassLoaderResolver()
Accessor for the ClassLoader resolver to use in class loading issues.
|
Integer |
getDatastoreReadTimeoutMillis()
Accessor for the datastore read timeout in milliseconds.
|
Integer |
getDatastoreWriteTimeoutMillis()
Accessor for the datastore write timeout in milliseconds.
|
List<ExecutionContext.EmbeddedOwnerRelation> |
getEmbeddedInformationForOwner(ObjectProvider ownerOP)
Accessor for the relations for the specified embedded ObjectProvider where it is embedded.
|
Extent |
getExtent(Class candidateClass,
boolean includeSubclasses)
Accessor for the Extent for a class (and optionally its subclasses).
|
Set |
getFetchGroupsWithName(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(Class cls,
String name)
Accessor for an internal fetch group for the specified class.
|
Integer |
getIntProperty(String name)
Accessor for an int property value.
|
Lock |
getLock()
Accessor for the lock object for this ExecutionContext.
|
LockManager |
getLockManager()
Accessor for the lock manager for this execution context.
|
Set |
getManagedObjects()
Accessor for the currently managed objects for the current transaction.
|
Set |
getManagedObjects(Class[] classes)
Accessor for the currently managed objects for the current transaction.
|
Set |
getManagedObjects(String[] states)
Accessor for the currently managed objects for the current transaction.
|
Set |
getManagedObjects(String[] states,
Class[] classes)
Accessor for the currently managed objects for the current transaction.
|
boolean |
getManageRelations()
Whether managed relations are supported by this execution context.
|
MetaDataManager |
getMetaDataManager()
Accessor for the MetaData Manager.
|
boolean |
getMultithreaded()
Accessor for whether this context is multithreaded.
|
NucleusContext |
getNucleusContext()
Accessor for the context in which this execution context is running.
|
Object |
getObjectFromCache(Object id)
Convenience method to access an object in the cache.
|
Object |
getObjectProviderAssociatedValue(ObjectProvider op,
Object key) |
Object[] |
getObjectsFromCache(Object[] ids)
Convenience method to access objects in the cache.
|
List<ObjectProvider> |
getObjectsToBeFlushed()
Convenience method to inspect the list of objects with outstanding changes to flush.
|
OperationQueue |
getOperationQueue()
Accessor for the operation queue.
|
Object |
getOwner()
Method to return the owner object.
|
List<ExecutionContext.EmbeddedOwnerRelation> |
getOwnerInformationForEmbedded(ObjectProvider embOP)
Accessor for the relations for the specified embedded ObjectProvider where it is embedded.
|
Map<String,Object> |
getProperties()
Accessor for the defined properties.
|
Object |
getProperty(String name)
Accessor for a property.
|
RelationshipManager |
getRelationshipManager(ObjectProvider op)
Accessor for the RelationshipManager for the provided ObjectProvider.
|
boolean |
getSerializeReadForClass(String className)
Convenience method to return the setting for serialize read for the current transaction for
the specified class name.
|
ManagerStatistics |
getStatistics()
Accessor for any statistics-gathering object.
|
StoreManager |
getStoreManager()
Accessor for the Store Manager.
|
String |
getStringProperty(String name)
Accessor for a String property value.
|
Set<String> |
getSupportedProperties()
Accessor for the supported property names.
|
Transaction |
getTransaction()
Accessor for the current transaction for this execution context.
|
TypeManager |
getTypeManager()
TODO should we keep this here? this is api/language dependent
|
boolean |
hasIdentityInCache(Object id)
Whether an object with the specified identity exists in the cache(s).
|
boolean |
hasPersistenceInformationForClass(Class cls)
Utility method to check if the specified class has reachable metadata or annotations.
|
void |
hereIsObjectProvider(ObjectProvider op,
Object pc)
Method to register the ObjectProvider as being for the passed object.
|
void |
initialise(Object owner,
Map<String,Object> options) |
boolean |
isClosed()
Accessor for whether this execution context is closed.
|
boolean |
isDelayDatastoreOperationsEnabled()
Whether the datastore operations are delayed until commit.
|
boolean |
isEnlistedInTransaction(Object id)
Method to return if an object is enlisted in the current transaction.
|
boolean |
isFlushing()
Accessor for whether the ExecutionContext is flushing changes to the datastore.
|
boolean |
isInserting(Object pc)
Tests whether this persistable object is being inserted.
|
boolean |
isManagingRelations()
Returns whether this ExecutionContext is currently performing the manage relationships task.
|
boolean |
isObjectModifiedInTransaction(Object id)
Accessor for whether the object with this identity is modified in the current transaction.
|
boolean |
isRunningDetachAllOnCommit()
Accessor for whether this ExecutionContext is currently running detachAllOnCommit.
|
void |
makeObjectNontransactional(Object pc)
Method to make the passed object nontransactional.
|
void |
makeObjectTransactional(Object pc)
Method to make the passed object transactional.
|
void |
makeObjectTransient(Object pc,
FetchPlanState state)
Method to make transient the passed object.
|
void |
markDirty(ObjectProvider op,
boolean directUpdate)
Mark the specified ObjectProvider as dirty
|
void |
markFieldsForUpdateInLevel2Cache(Object id,
boolean[] fields)
Method to mark the object with specifed id to have the supplied fields updated in the L2 cache at commit.
|
Object |
newInstance(Class cls)
Method to generate an instance of an interface, abstract class, or concrete PC class.
|
Object |
newObjectId(Class pcClass,
Object key)
This method returns an object id instance corresponding to the pcClass and key arguments.
|
Object |
newObjectId(String className,
Object pc)
This method returns an object id instance corresponding to the class name, and the passed
object (when using app identity).
|
ObjectProvider |
newObjectProviderForDetached(Object pc,
Object id,
Object version)
Constructor for creating ObjectProvider instances to manage persistable objects in detached state.
|
ObjectProvider |
newObjectProviderForEmbedded(AbstractClassMetaData cmd,
ObjectProvider ownerOP,
int ownerFieldNumber)
Constructs an ObjectProvider for an object of the specified type, creating the PC object to hold the values
where this object will be EMBEDDED/SERIALISED into another persistable object.
|
ObjectProvider |
newObjectProviderForEmbedded(Object pc,
boolean copyPc,
ObjectProvider ownerOP,
int ownerFieldNumber)
Constructs an ObjectProvider to manage a persistable instance that will
be EMBEDDED/SERIALISED into another persistable object.
|
ObjectProvider |
newObjectProviderForHollow(Class pcClass,
Object id)
Constructs an ObjectProvider to manage a hollow instance having the given object ID.
|
ObjectProvider |
newObjectProviderForHollowPopulated(Class pcClass,
Object id,
FieldValues fv)
Constructs an ObjectProvider to manage a recently populated hollow instance having the
given object ID and the given field values.
|
ObjectProvider |
newObjectProviderForHollowPopulatedAppId(Class pcClass,
FieldValues fv)
Deprecated.
Use newForHollowPopulated instead
|
ObjectProvider |
newObjectProviderForHollowPreConstructed(Object id,
Object pc)
Constructs an ObjectProvider to manage a hollow instance having the given object ID.
|
ObjectProvider |
newObjectProviderForPersistentClean(Object id,
Object pc)
Constructs an ObjectProvider to manage the specified persistent instance having the given object ID.
|
ObjectProvider |
newObjectProviderForPersistentNew(Object pc,
FieldValues fv)
Constructs an ObjectProvider to manage a transient instance that is
becoming newly persistent.
|
ObjectProvider |
newObjectProviderForPNewToBeDeleted(Object pc)
Constructor for creating ObjectProvider instances to manage persistable objects that are not persistent yet
are about to be deleted.
|
ObjectProvider |
newObjectProviderForTransactionalTransient(Object pc)
Constructs an ObjectProvider to manage a Transactional Transient instance.
|
Query |
newQuery()
Accessor for a new Query.
|
Object |
persistObject(Object pc,
boolean merging)
Method to persist the passed object.
|
Object |
persistObjectInternal(Object pc,
FieldValues preInsertChanges,
int objectType)
Method to persist the passed object (internally).
|
Object |
persistObjectInternal(Object pc,
FieldValues preInsertChanges,
ObjectProvider ownerOP,
int ownerFieldNum,
int objectType)
Method to persist the passed object (internally).
|
Object |
persistObjectInternal(Object pc,
ObjectProvider ownerOP,
int ownerFieldNum,
int objectType)
Method to persist the passed object (internally).
|
Object[] |
persistObjects(Object[] pcs)
Method to persist the passed object(s).
|
void |
processNontransactionalUpdate()
Method to process any outstanding non-transactional updates that are queued.
|
void |
putObjectIntoLevel1Cache(ObjectProvider op)
Method to put a Persistable object associated to the ObjectProvider into the L1 cache.
|
void |
refreshAllObjects()
Method to refresh all L1 cache objects
|
void |
refreshObject(Object pc)
Method to refresh the passed object.
|
ExecutionContext.EmbeddedOwnerRelation |
registerEmbeddedRelation(ObjectProvider ownerOP,
int ownerFieldNum,
ObjectProvider embOP)
Method to register an embedded relation for the specified memberf of the owner ObjectProvider
where the embedded ObjectProvider is stored.
|
void |
removeEmbeddedOwnerRelation(ObjectProvider ownerOP,
int ownerFieldNum,
ObjectProvider embOP)
Convenience method to remove the EmbeddedOwnerRelation between the specified ObjectProviders.
|
void |
removeListener(Object listener)
Method to remove a currently registered listener.
|
void |
removeObjectFromLevel1Cache(Object id)
Method to remove an object from the L1 cache.
|
void |
removeObjectFromLevel2Cache(Object id)
Method to remove an object from the L2 cache.
|
void |
removeObjectProvider(ObjectProvider op)
Method to remove the object managed by the specified ObjectProvider from the cache.
|
void |
removeObjectProviderAssociatedValue(ObjectProvider op,
Object key) |
void |
replaceObjectId(Object pc,
Object oldID,
Object newID)
Replace the previous object id for a PC object to a new
|
void |
retrieveObject(Object pc,
boolean fgOnly)
Method to retrieve the passed object.
|
void |
setAttachDetachReferencedObject(ObjectProvider op,
Object obj)
Register a referenced object against this ObjectProvider for the attach/detach process.
|
void |
setObjectProviderAssociatedValue(ObjectProvider op,
Object key,
Object value) |
void |
setProperties(Map props)
Method to set properties on the execution context.
|
void |
setProperty(String name,
Object value)
Method to set a property on the execution context
|
static final String OPTION_USERNAME
static final String OPTION_PASSWORD
static final String OPTION_JTA_AUTOJOIN
Object getOwner()
Transaction getTransaction()
StoreManager getStoreManager()
MetaDataManager getMetaDataManager()
NucleusContext getNucleusContext()
ApiAdapter getApiAdapter()
FetchPlan getFetchPlan()
ClassLoaderResolver getClassLoaderResolver()
LockManager getLockManager()
ManagerStatistics getStatistics()
void setProperties(Map props)
props
- The propertiesvoid setProperty(String name, Object value)
name
- Name of the propertyvalue
- Value to setObject getProperty(String name)
name
- Name of the propertyBoolean getBooleanProperty(String name)
name
- Name of the propertyInteger getIntProperty(String name)
name
- Name of the propertyString getStringProperty(String name)
name
- Name of the propertyMap<String,Object> getProperties()
Set<String> getSupportedProperties()
TypeManager getTypeManager()
void close()
boolean isClosed()
boolean getIgnoreCache()
Integer getDatastoreReadTimeoutMillis()
Integer getDatastoreWriteTimeoutMillis()
ObjectProvider findObjectProvider(Object pc)
pc
- The persistable objectObjectProvider findObjectProvider(Object pc, boolean persist)
pc
- The persistable objectpersist
- Whether to persist if not yet persistentObjectProvider findObjectProviderForEmbedded(Object value, ObjectProvider owner, AbstractMemberMetaData mmd)
value
- The embedded objectowner
- The owner ObjectProvider (if known).mmd
- Metadata for the field of the ownerObjectProvider findObjectProviderOfOwnerForAttachingObject(Object pc)
void hereIsObjectProvider(ObjectProvider op, Object pc)
op
- The ObjectProviderpc
- The object managed by the ObjectProviderObjectProvider newObjectProviderForHollow(Class pcClass, Object id)
pcClass
- the class of the new instance to be created.id
- the JDO identity of the object.ObjectProvider newObjectProviderForHollowPreConstructed(Object id, Object pc)
id
- the JDO identity of the object.pc
- The object that is hollow that we are going to manageObjectProvider newObjectProviderForHollowPopulated(Class pcClass, Object id, FieldValues fv)
pcClass
- the class of the new instance to be created.id
- the JDO identity of the object.fv
- the initial field values of the object.ObjectProvider newObjectProviderForPersistentClean(Object id, Object pc)
id
- the JDO identity of the object.pc
- The object that is persistent that we are going to manageObjectProvider newObjectProviderForHollowPopulatedAppId(Class pcClass, FieldValues fv)
pcClass
- the class of the new instance to be created.fv
- the initial field values of the object.ObjectProvider newObjectProviderForEmbedded(Object pc, boolean copyPc, ObjectProvider ownerOP, int ownerFieldNumber)
pc
- The persistable to manage (see copyPc also)copyPc
- Whether the SM should manage a copy of the passed PC or that oneownerOP
- Owner ObjectProviderownerFieldNumber
- Field number in owner object where this is storedObjectProvider newObjectProviderForEmbedded(AbstractClassMetaData cmd, ObjectProvider ownerOP, int ownerFieldNumber)
cmd
- Meta-data for the class that this is an instance of.ownerOP
- Owner ObjectProviderownerFieldNumber
- Field number in owner object where this is storedObjectProvider newObjectProviderForPersistentNew(Object pc, FieldValues fv)
pc
- the instance being make persistent.fv
- Any changes to make before insertingObjectProvider newObjectProviderForTransactionalTransient(Object pc)
pc
- the instance being make persistent.ObjectProvider newObjectProviderForDetached(Object pc, Object id, Object version)
pc
- the detached objectid
- the JDO identity of the object.version
- the detached versionObjectProvider newObjectProviderForPNewToBeDeleted(Object pc)
pc
- the object being deleted from persistencevoid addObjectProvider(ObjectProvider op)
op
- The ObjectProvidervoid removeObjectProvider(ObjectProvider op)
op
- The ObjectProvidervoid evictObject(Object pc)
pc
- The objectvoid evictObjects(Class cls, boolean subclasses)
cls
- Type of persistable objectsubclasses
- Whether to include subclassesvoid evictAllObjects()
void retrieveObject(Object pc, boolean fgOnly)
pc
- The objectfgOnly
- Just retrieve the current fetch groupObject persistObject(Object pc, boolean merging)
pc
- The objectmerging
- Whether this object (and dependents) is being mergedObject[] persistObjects(Object[] pcs)
pcs
- The objects to persistObject persistObjectInternal(Object pc, FieldValues preInsertChanges, ObjectProvider ownerOP, int ownerFieldNum, int objectType)
pc
- The objectpreInsertChanges
- Changes to be made before insertingownerOP
- ObjectProvider of the owner when embeddedownerFieldNum
- Field number in the owner where this is embedded (or -1 if not embedded)objectType
- Type of object (see org.datanucleus.store.ObjectProvider, e.g ObjectProvider.PC)Object persistObjectInternal(Object pc, ObjectProvider ownerOP, int ownerFieldNum, int objectType)
pc
- The objectownerOP
- ObjectProvider of the owner when embeddedownerFieldNum
- Field number in the owner where this is embedded (or -1 if not embedded)objectType
- Type of object (see org.datanucleus.state.ObjectProvider, e.g ObjectProvider.PC)Object persistObjectInternal(Object pc, FieldValues preInsertChanges, int objectType)
pc
- The objectpreInsertChanges
- Changes to be made before insertingobjectType
- Type of object (see org.datanucleus.state.ObjectProvider, e.g ObjectProvider.PC)void makeObjectTransient(Object pc, FetchPlanState state)
pc
- The objectstate
- Object containing the state of the fetchplan processingvoid makeObjectTransactional(Object pc)
pc
- The objectvoid makeObjectNontransactional(Object pc)
pc
- The objectboolean exists(Object obj)
obj
- The (persistable) objectSet getManagedObjects()
Set getManagedObjects(Class[] classes)
classes
- Classes that we want the objects forSet getManagedObjects(String[] states)
states
- States that we want the objects forSet getManagedObjects(String[] states, Class[] classes)
states
- States that we want the objects forclasses
- Classes that we want the objects forvoid deleteObject(Object obj)
obj
- The objectvoid deleteObjects(Object[] objs)
objs
- The objects to deletevoid deleteObjectInternal(Object pc)
pc
- The objectvoid detachObject(Object pc, FetchPlanState state)
pc
- The object to detachstate
- State for the detachment process.Object detachObjectCopy(Object pc, FetchPlanState state)
pc
- The objectstate
- State for the detachment processvoid detachAll()
void attachObject(ObjectProvider op, Object pc, boolean sco)
op
- ObjectProvider of the owning object that has this in a field causing its attachpc
- The (detached) objectsco
- Whether the object has no identity (embedded or serialised)Object attachObjectCopy(ObjectProvider op, Object pc, boolean sco)
op
- ObjectProvider of the owning object that has this in a field causing its attachpc
- The objectsco
- Whether it has no identity (second-class object)Object getAttachedObjectForId(Object id)
id
- The idvoid refreshObject(Object pc)
pc
- The objectvoid refreshAllObjects()
void enlistInTransaction(ObjectProvider op)
op
- The ObjectProviderboolean isEnlistedInTransaction(Object id)
id
- Identity for the objectvoid evictFromTransaction(ObjectProvider op)
op
- The ObjectProvidervoid markDirty(ObjectProvider op, boolean directUpdate)
op
- ObjectProviderdirectUpdate
- Whether the object has had a direct update made on it (if known)void clearDirty(ObjectProvider op)
op
- The ObjectProvidervoid clearDirty()
boolean isDelayDatastoreOperationsEnabled()
void processNontransactionalUpdate()
Object findObject(Object id, boolean validate, boolean checkInheritance, String objectClassName)
id
- Id of the object.validate
- Whether to validate the object statecheckInheritance
- 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)Object findObject(Object id, FieldValues fv, Class pcClass, boolean ignoreCache, boolean checkInheritance)
id
- Id of the object.fv
- FieldValues to apply to the object (optional)pcClass
- the type which the object is. This type will be used to instantiate the objectignoreCache
- true if the cache is ignoredcheckInheritance
- Whether to check the inheritance of this objectObject[] findObjects(Object[] ids, boolean validate)
ids
- Ids of the object(s).validate
- Whether to validate the object stateNucleusObjectNotFoundException
- if an object doesn't exist in the datastoreExtent getExtent(Class candidateClass, boolean includeSubclasses)
candidateClass
- The classincludeSubclasses
- Whether to include subclassesQuery newQuery()
void putObjectIntoLevel1Cache(ObjectProvider op)
op
- The ObjectProviderObject getObjectFromCache(Object id)
id
- Id of the objectObject[] getObjectsFromCache(Object[] ids)
ids
- Ids of the objectsvoid removeObjectFromLevel1Cache(Object id)
id
- The id of the objectvoid removeObjectFromLevel2Cache(Object id)
id
- The id of the objectvoid markFieldsForUpdateInLevel2Cache(Object id, boolean[] fields)
id
- Id of the objectfields
- The fields to updateboolean hasIdentityInCache(Object id)
id
- The identityObject newObjectId(Class pcClass, Object key)
pcClass
- Class of the persistable object to create the identity forkey
- Value of the key for SingleFieldIdentity (or the toString value)Object newObjectId(String className, Object pc)
className
- Name of the class of the object.pc
- The persistable object. Used for application-identityboolean getSerializeReadForClass(String className)
className
- Name of the classvoid assertClassPersistable(Class cls)
cls
- The class of which we want to persist objectsClassNotPersistableException
- When the class is not persistableNoPersistenceInformationException
- When the class has no available persistence informationboolean hasPersistenceInformationForClass(Class cls)
cls
- The class to checkboolean isInserting(Object pc)
pc
- the object to verify the statusboolean isFlushing()
boolean isRunningDetachAllOnCommit()
void flush()
void flushInternal(boolean flushToDatastore)
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 datastoreNucleusOptimisticException
- when optimistic locking error(s) occurOperationQueue getOperationQueue()
void addOperationToQueue(Operation oper)
oper
- The operation to addvoid flushOperationsForBackingStore(Store backingStore, ObjectProvider op)
backingStore
- The backing storeop
- ObjectProviderboolean getMultithreaded()
boolean getManageRelations()
RelationshipManager getRelationshipManager(ObjectProvider op)
op
- ObjectProviderboolean isManagingRelations()
List<ObjectProvider> getObjectsToBeFlushed()
CallbackHandler getCallbackHandler()
void addListener(Object listener, Class[] classes)
listener
- The listener to sends events toclasses
- The classes that it is interested invoid removeListener(Object listener)
listener
- The instance lifecycle listener to remove.void disconnectLifecycleListener()
FetchGroup getInternalFetchGroup(Class cls, String name)
cls
- The classname
- Name of the groupvoid addInternalFetchGroup(FetchGroup grp)
grp
- The internal fetch groupSet getFetchGroupsWithName(String name)
name
- Name of the groupLock getLock()
Object newInstance(Class cls)
cls
- The class of the interface or abstract class, or concrete class defined in MetaDataboolean isObjectModifiedInTransaction(Object id)
id
- The identity.void replaceObjectId(Object pc, Object oldID, Object newID)
pc
- The Persistable objectoldID
- the old idnewID
- the new idObject getAttachDetachReferencedObject(ObjectProvider op)
op
- Object providervoid setAttachDetachReferencedObject(ObjectProvider op, Object obj)
op
- The ObjectProviderobj
- The referenced object (or null to clear out any reference)ExecutionContext.EmbeddedOwnerRelation registerEmbeddedRelation(ObjectProvider ownerOP, int ownerFieldNum, ObjectProvider embOP)
ownerOP
- Owner ObjectProviderownerFieldNum
- Member number that is embeddedembOP
- ObjectProvider of the embedded objectvoid deregisterEmbeddedRelation(ExecutionContext.EmbeddedOwnerRelation rel)
rel
- The embedded relationList<ExecutionContext.EmbeddedOwnerRelation> getOwnerInformationForEmbedded(ObjectProvider embOP)
embOP
- The ObjectProvider that is embeddedList<ExecutionContext.EmbeddedOwnerRelation> getEmbeddedInformationForOwner(ObjectProvider ownerOP)
ownerOP
- The ObjectProvider that owns the embeddedvoid removeEmbeddedOwnerRelation(ObjectProvider ownerOP, int ownerFieldNum, ObjectProvider embOP)
ownerOP
- Owner ObjectProviderownerFieldNum
- Field in ownerembOP
- Embedded ObjectProvidervoid setObjectProviderAssociatedValue(ObjectProvider op, Object key, Object value)
Object getObjectProviderAssociatedValue(ObjectProvider op, Object key)
void removeObjectProviderAssociatedValue(ObjectProvider op, Object key)
boolean containsObjectProviderAssociatedValue(ObjectProvider op, Object key)
Copyright © 2019. All rights reserved.