|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.ObjectManagerImpl
com.force.sdk.jpa.ForceObjectManagerImpl
public class ForceObjectManagerImpl
Object manager for the objects being created, updated, or deleted. Special handling for all-or-nothing operations.
| Field Summary |
|---|
| Fields inherited from class org.datanucleus.ObjectManagerImpl |
|---|
LOCALISER |
| Constructor Summary | |
|---|---|
ForceObjectManagerImpl(org.datanucleus.ObjectManagerFactoryImpl omf,
Object owner,
String userName,
String password)
Creates an object manager with datastore credentials. |
|
| Method Summary | |
|---|---|
void |
addToCreateList(com.sforce.soap.partner.sobject.SObject object,
org.datanucleus.store.ObjectProvider op)
Adds an object to the current list of entities to be created. |
void |
addToDeleteList(String id)
Adds an entity to the current list of entities to be deleted. |
void |
addToUpdateList(com.sforce.soap.partner.sobject.SObject object,
Calendar version)
Adds an object to the current list of entities to be updated. |
void |
detachObject(Object obj,
org.datanucleus.state.FetchPlanState state)
Added this method so that we can support detachment of a newly created persistent object that has never been saved to the database. |
void |
flushInternal(boolean flushToDatastore)
Flushes all dirty, new, and deleted instances to the datastore. |
com.sforce.soap.partner.sobject.SObject |
getParentSObject(Object parent)
Retrieves the Force.com object (SObject) for the given parent. |
boolean |
isInAllOrNothingMode()
Checks whether an active transaction is currently flushing data to the datastore in all or nothing mode. |
void |
markDirty(org.datanucleus.StateManager sm,
boolean directUpdate)
Marks an object (StateManager) as dirty. |
void |
postRollback()
There are some cases when a postRollback tries to detach an object that has not been persisted. |
| Methods inherited from class org.datanucleus.ObjectManagerImpl |
|---|
acquireThreadContextInfo, addInternalFetchGroup, addListener, addStateManager, assertActiveTransaction, assertClassPersistable, assertDetachable, assertHasImplementationCreator, assertIsOpen, assertNotDetached, assertWritable, attachObject, attachObjectCopy, clearDirty, clearDirty, close, deleteObject, deleteObjectInternal, deleteObjects, detachAll, detachObjectCopy, disconnectLifecycleListener, disconnectSMCache, enlistInTransaction, evictAllObjects, evictFromTransaction, evictObject, evictObjects, exists, findObject, findObject, findObjects, findObjectUsingAID, findStateManager, flush, getApiAdapter, getAttachedObjectForId, getCallbackHandler, getClassLoaderResolver, getCopyOnAttach, getDatastoreReadTimeoutMillis, getDatastoreWriteTimeoutMillis, getDetachAllOnCommit, getDetachAllOnRollback, getDetachOnClose, getExecutionContext, getExtent, getFetchGroupManager, getFetchGroupsWithName, getFetchPlan, getIdentityAsString, getIgnoreCache, getInternalFetchGroup, getLockManager, getManagedObjects, getManagedObjects, getManagedObjects, getManagedObjects, getMetaDataManager, getMultithreaded, getObjectFromCache, getObjectManagerFactory, getOMFContext, getOwner, getReadWriteLock, getSerializeReadForClass, getStateManagerById, getStoreManager, getThreadContextInfo, getTransaction, hasIdentityInCache, hasPersistenceInformationForClass, hereIsStateManager, initialiseLevel1Cache, isClosed, isDelayDatastoreOperationsEnabled, isEnlistedInTransaction, isFlushing, isInserting, isManagingRelations, isObjectModifiedInTransaction, isRunningDetachAllOnCommit, makeObjectNontransactional, makeObjectTransactional, makeObjectTransient, markManagedRelationDirty, newInstance, newObjectId, newObjectId, newQuery, nontransactionalUpdateCommit, performManagedRelationships, persistObject, persistObjectInternal, persistObjects, postBegin, postClose, postCommit, preCommit, preRollback, putObjectIntoCache, putObjectIntoLevel2Cache, putObjectIntoLevel2CacheInternal, refreshAllObjects, refreshObject, releaseThreadContextInfo, removeAllInstanceLifecycleListeners, removeInternalFetchGroup, removeListener, removeObjectFromCache, removeObjectFromLevel2Cache, removeStateManager, replaceObjectId, retrieveObject, setCopyOnAttach, setDatastoreReadTimeoutMillis, setDatastoreWriteTimeoutMillis, setDetachAllOnCommit, setDetachAllOnRollback, setDetachOnClose, setIgnoreCache, setMultithreaded |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ForceObjectManagerImpl(org.datanucleus.ObjectManagerFactoryImpl omf,
Object owner,
String userName,
String password)
omf - the object manager factoryowner - the owning persistence manager or entity manageruserName - the username to the datastorepassword - the password to the datastore| Method Detail |
|---|
public boolean isInAllOrNothingMode()
true if all or nothing mode is enabled and we are currently flushing data in this modepublic void flushInternal(boolean flushToDatastore)
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.
flushInternal in interface org.datanucleus.ObjectManagerflushInternal in class org.datanucleus.ObjectManagerImplflushToDatastore - Whether to ensure any changes reach the datastore.
Otherwise, they will be flushed to the datastore manager which
determines the opportune moment to actually flush them to the datastorepublic com.sforce.soap.partner.sobject.SObject getParentSObject(Object parent)
parent - Object
public void addToCreateList(com.sforce.soap.partner.sobject.SObject object,
org.datanucleus.store.ObjectProvider op)
object - the object to be createdop - the object provider
public void addToUpdateList(com.sforce.soap.partner.sobject.SObject object,
Calendar version)
object - the object to update (complete with updated fields)version - this should be the time of modification. Pass in a version if we're checking
if-modified-before headers for optimistic transactionspublic void addToDeleteList(String id)
id - the id of the entity to delete
public void markDirty(org.datanucleus.StateManager sm,
boolean directUpdate)
markDirty in interface org.datanucleus.ObjectManagermarkDirty in class org.datanucleus.ObjectManagerImplsm - The StateManagerdirectUpdate - Flags whether the object has had a direct update made on it (if known)public void postRollback()
NucleusObjectNotFoundException
since the object was never stored in the database. We can ignore that exception.
postRollback in interface org.datanucleus.ObjectManagerpostRollback in class org.datanucleus.ObjectManagerImpl
public void detachObject(Object obj,
org.datanucleus.state.FetchPlanState state)
detachObject in interface org.datanucleus.ObjectManagerdetachObject in class org.datanucleus.ObjectManagerImpl
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||