Package org.eclipse.persistence.queries
Class ObjectLevelModifyQuery
- java.lang.Object
-
- org.eclipse.persistence.queries.DatabaseQuery
-
- org.eclipse.persistence.queries.ModifyQuery
-
- org.eclipse.persistence.queries.ObjectLevelModifyQuery
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
DeleteObjectQuery,WriteObjectQuery
public abstract class ObjectLevelModifyQuery extends ModifyQuery
Purpose: Abstract class for all object modify queries.
Responsibilities:
- Stores & retrieves the object to modify.
- Stores & retrieves the primary key of the objects.
- Since:
- TOPLink/Java 1.0
- Author:
- Yvon Lavoie
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.queries.DatabaseQuery
DatabaseQuery.ParameterType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.ObjectbackupCloneprotected java.lang.Objectobjectprotected ObjectChangeSetobjectChangeSetprotected java.lang.ObjectprimaryKey-
Fields inherited from class org.eclipse.persistence.queries.ModifyQuery
forceBatchStatementExecution, isBatchExecutionSupported, modifyRow
-
Fields inherited from class org.eclipse.persistence.queries.DatabaseQuery
accessors, allowNativeSQLQuery, argumentFields, argumentParameterTypes, arguments, argumentTypeNames, argumentTypes, argumentValues, BATCH_FETCH_PROPERTY, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, cascadePolicy, CascadePrivateParts, descriptor, descriptors, doNotRedirect, executionSession, flushOnExecute, hintString, isCustomQueryUsed, isExecutionClone, isNativeConnectionRequired, isPrepared, isUserDefined, isUserDefinedSQLCall, monitorName, name, NoCascading, nullableArguments, parameterDelimiter, partitioningPolicy, properties, queryMechanism, queryTimeout, queryTimeoutUnit, redirector, session, sessionName, shouldBindAllParameters, shouldCacheStatement, shouldCloneCall, shouldMaintainCache, shouldPrepare, shouldRetrieveBypassCache, shouldReturnGeneratedKeys, shouldStoreBypassCache, shouldUseWrapperPolicy, shouldValidateUpdateCallCacheUse, sourceMapping, translationRow
-
-
Constructor Summary
Constructors Constructor Description ObjectLevelModifyQuery()PUBLIC: Initialize the state of the query.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckDescriptor(AbstractSession session)INTERNAL: Ensure that the descriptor has been set.java.lang.ObjectexecuteInUnitOfWork(UnitOfWorkImpl unitOfWork, AbstractRecord translationRow)INTERNAL: All have done is move code from UnitOfWork.internalExecuteQueryprotected java.lang.ObjectexecuteInUnitOfWorkObjectLevelModifyQuery(UnitOfWorkImpl unitOfWork, AbstractRecord translationRow)INTERNAL: This code was moved from UnitOfWork.internalExecuteQuery.java.lang.ObjectgetBackupClone()INTERNAL: Return the backup clone of the object from the unit of work.java.lang.ObjectgetObject()PUBLIC: Return the object required for modification.ObjectChangeSetgetObjectChangeSet()PUBLIC: Return the ObjectChangeSet representing the object being changedjava.lang.ObjectgetPrimaryKey()INTERNAL: Get the primary key for the queryjava.lang.ClassgetReferenceClass()Return the domain class associated with this query.java.lang.StringgetReferenceClassName()INTERNAL: Return the reference class for a query Note: Although the API is designed to avoid classpath dependencies for the MW, since the object is specified at runtime, this will not be an issue.booleanisObjectLevelModifyQuery()PUBLIC: Return if this is an object level modify query.protected voidprepare()INTERNAL: Prepare the receiver for execution in a session.voidprepareForExecution()INTERNAL: Prepare the receiver for execution in a session.voidresetMonitorName()INTERNAL: Return the name to use for the query in performance monitoring.voidsetBackupClone(java.lang.Object backupClone)INTERNAL: Set the backup clone of the object from the unit of work.voidsetObject(java.lang.Object object)PUBLIC: (REQUIRED) Set the object required for modification.voidsetObjectChangeSet(ObjectChangeSet changeSet)INTERNAL: Set the ObjectChangeSet representing the object to be writtenvoidsetPrimaryKey(java.lang.Object primaryKey)INTERNAL: Set the primary key for the query.java.lang.StringtoString()-
Methods inherited from class org.eclipse.persistence.queries.ModifyQuery
forceBatchStatementExecution, getModifyRow, isBatchExecutionSupported, isModifyQuery, setForceBatchStatementExecution, setIsBatchExecutionSupported, setModifyRow
-
Methods inherited from class org.eclipse.persistence.queries.DatabaseQuery
addArgument, addArgument, addArgument, addArgument, addArgument, addArgument, addArgumentByTypeName, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, buildArgumentFields, buildSelectionCriteria, cacheStatement, cascadeAllParts, cascadeByMapping, cascadeOnlyDependentParts, cascadePrivateParts, checkEarlyReturn, checkForCustomQuery, checkPrepare, checkPrepare, clone, clonedQueryExecutionComplete, convertClassNamesToClasses, copyFromQuery, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, execute, executeDatabaseQuery, extractRemoteResult, getAccessor, getAccessors, getArgumentParameterTypes, getArguments, getArgumentTypeNames, getArgumentTypes, getArgumentValues, getBatchObjects, getCall, getCascadePolicy, getDatasourceCall, getDatasourceCalls, getDefaultRedirector, getDescriptor, getDescriptors, getDomainClassNounName, getDoNotRedirect, getEJBQLString, getExecutionSession, getFlushOnExecute, getHintString, getJPQLString, getMonitorName, getName, getNullableArguments, getParameterDelimiter, getParameterDelimiterChar, getPartitioningPolicy, getProperties, getProperty, getQueryMechanism, getQueryNounName, getQueryTimeout, getQueryTimeoutUnit, getRedirector, getRedirectorForQuery, getSelectionCriteria, getSensorName, getSession, getSessionName, getShouldBindAllParameters, getSourceMapping, getSQLStatement, getSQLString, getSQLStrings, getTranslatedSQLString, getTranslatedSQLStrings, getTranslationRow, hasAccessor, hasArguments, hasNullableArguments, hasProperties, hasQueryMechanism, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isCascadeOfAggregateDelete, isCustomQueryUsed, isCustomSelectionQuery, isDataModifyQuery, isDataReadQuery, isDefaultPropertiesQuery, isDeleteAllQuery, isDeleteObjectQuery, isDirectReadQuery, isExecutionClone, isExpressionQuery, isInsertObjectQuery, isJPQLCallQuery, isModifyAllQuery, isNativeConnectionRequired, isObjectBuildingQuery, isObjectLevelReadQuery, isPrepared, isReadAllQuery, isReadObjectQuery, isReadQuery, isReportQuery, isResultSetMappingQuery, isSQLCallQuery, isUpdateAllQuery, isUpdateObjectQuery, isUserDefined, isUserDefinedSQLCall, isValueReadQuery, isWriteObjectQuery, maintainCache, prepareCall, prepareCustomQuery, prepareForRemoteExecution, prepareFromQuery, prepareInternal, redirectQuery, remoteExecute, remoteExecute, removeProperty, replaceValueHoldersIn, retrieveBypassCache, rowFromArguments, setAccessor, setAccessors, setAllowNativeSQLQuery, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setBatchObjects, setCall, setCascadePolicy, setDatasourceCall, setDescriptor, setDoNotRedirect, setEJBQLString, setExecutionSession, setFlushOnExecute, setHintString, setIsCustomQueryUsed, setIsExecutionClone, setIsNativeConnectionRequired, setIsPrepared, setIsUserDefined, setIsUserDefinedSQLCall, setJPQLString, setName, setNullableArguments, setParameterDelimiter, setPartitioningPolicy, setProperties, setProperty, setQueryMechanism, setQueryTimeout, setQueryTimeoutUnit, setRedirector, setSelectionCriteria, setSession, setSessionName, setShouldBindAllParameters, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldRetrieveBypassCache, setShouldReturnGeneratedKeys, setShouldStoreBypassCache, setShouldUseWrapperPolicy, setShouldValidateUpdateCallCacheUse, setSourceMapping, setSQLStatement, setSQLString, setTranslationRow, shouldAllowNativeSQLQuery, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeByMapping, shouldCascadeOnlyDependentParts, shouldCascadeParts, shouldCascadePrivateParts, shouldCloneCall, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldPrepare, shouldRetrieveBypassCache, shouldReturnGeneratedKeys, shouldStoreBypassCache, shouldUseWrapperPolicy, shouldValidateUpdateCallCacheUse, storeBypassCache
-
-
-
-
Field Detail
-
primaryKey
protected java.lang.Object primaryKey
-
object
protected java.lang.Object object
-
objectChangeSet
protected ObjectChangeSet objectChangeSet
-
backupClone
protected java.lang.Object backupClone
-
-
Method Detail
-
checkDescriptor
public void checkDescriptor(AbstractSession session) throws QueryException
INTERNAL: Ensure that the descriptor has been set.- Overrides:
checkDescriptorin classDatabaseQuery- Throws:
QueryException
-
executeInUnitOfWork
public java.lang.Object executeInUnitOfWork(UnitOfWorkImpl unitOfWork, AbstractRecord translationRow) throws DatabaseException
INTERNAL: All have done is move code from UnitOfWork.internalExecuteQuery- Overrides:
executeInUnitOfWorkin classDatabaseQuery- Parameters:
unitOfWork- - the session in which the receiver will be executed.translationRow- - the arguments- Returns:
- An object, the result of executing the query.
- Throws:
DatabaseException- - an error has occurred on the database.
-
executeInUnitOfWorkObjectLevelModifyQuery
protected java.lang.Object executeInUnitOfWorkObjectLevelModifyQuery(UnitOfWorkImpl unitOfWork, AbstractRecord translationRow) throws DatabaseException, OptimisticLockException
INTERNAL: This code was moved from UnitOfWork.internalExecuteQuery.
-
getBackupClone
public java.lang.Object getBackupClone()
INTERNAL: Return the backup clone of the object from the unit of work.
-
getObject
public java.lang.Object getObject()
PUBLIC: Return the object required for modification.
-
getObjectChangeSet
public ObjectChangeSet getObjectChangeSet()
PUBLIC: Return the ObjectChangeSet representing the object being changed
-
getPrimaryKey
public java.lang.Object getPrimaryKey()
INTERNAL: Get the primary key for the query
-
getReferenceClass
public java.lang.Class getReferenceClass()
Return the domain class associated with this query.- Overrides:
getReferenceClassin classDatabaseQuery
-
getReferenceClassName
public java.lang.String getReferenceClassName()
INTERNAL: Return the reference class for a query Note: Although the API is designed to avoid classpath dependencies for the MW, since the object is specified at runtime, this will not be an issue.- Overrides:
getReferenceClassNamein classDatabaseQuery
-
resetMonitorName
public void resetMonitorName()
INTERNAL: Return the name to use for the query in performance monitoring.- Overrides:
resetMonitorNamein classDatabaseQuery
-
isObjectLevelModifyQuery
public boolean isObjectLevelModifyQuery()
PUBLIC: Return if this is an object level modify query.- Overrides:
isObjectLevelModifyQueryin classDatabaseQuery
-
prepare
protected void prepare() throws QueryExceptionINTERNAL: Prepare the receiver for execution in a session. In particular check that the tables on the descriptor are set.- Overrides:
preparein classDatabaseQuery- Throws:
QueryException
-
prepareForExecution
public void prepareForExecution() throws QueryExceptionINTERNAL: Prepare the receiver for execution in a session. In particular check that the tables on the descriptor are set.- Overrides:
prepareForExecutionin classDatabaseQuery- Throws:
QueryException
-
setBackupClone
public void setBackupClone(java.lang.Object backupClone)
INTERNAL: Set the backup clone of the object from the unit of work.
-
setObject
public void setObject(java.lang.Object object)
PUBLIC: (REQUIRED) Set the object required for modification.
-
setObjectChangeSet
public void setObjectChangeSet(ObjectChangeSet changeSet)
INTERNAL: Set the ObjectChangeSet representing the object to be written
-
setPrimaryKey
public void setPrimaryKey(java.lang.Object primaryKey)
INTERNAL: Set the primary key for the query.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classDatabaseQuery
-
-