EclipseLink 1.2.0, build 'v20091016-r5565' API Reference

org.eclipse.persistence.queries
Class DeleteObjectQuery

java.lang.Object
  extended by org.eclipse.persistence.queries.DatabaseQuery
      extended by org.eclipse.persistence.queries.ModifyQuery
          extended by org.eclipse.persistence.queries.ObjectLevelModifyQuery
              extended by org.eclipse.persistence.queries.DeleteObjectQuery
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class DeleteObjectQuery
extends ObjectLevelModifyQuery

Purpose: Used for deleting objects.

Responsibilities: Extract primary key from object and delete it.

See Also:
Serialized Form
Author:
Yvon Lavoie
Since:
TOPLink/Java 1.0

Field Summary
protected  boolean isFullRowRequired
          PERF: By default only the translation row is used for deletes, the full row can be requested for custom deletes.
 
Fields inherited from class org.eclipse.persistence.queries.ObjectLevelModifyQuery
backupClone, object, objectChangeSet, primaryKey
 
Fields inherited from class org.eclipse.persistence.queries.ModifyQuery
forceBatchStatementExecution, modifyRow
 
Fields inherited from class org.eclipse.persistence.queries.DatabaseQuery
accessor, argumentFields, arguments, argumentTypeNames, argumentTypes, argumentValues, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, cascadePolicy, CascadePrivateParts, descriptor, doNotRedirect, executionSession, flushOnExecute, hintString, isCustomQueryUsed, isExecutionClone, isNativeConnectionRequired, isPrepared, isUserDefined, name, NoCascading, properties, queryMechanism, queryTimeout, redirector, session, sessionName, shouldBindAllParameters, shouldCacheStatement, shouldCloneCall, shouldMaintainCache, shouldPrepare, shouldRetrieveBypassCache, shouldStoreBypassCache, shouldUseWrapperPolicy, sourceMapping, translationRow
 
Constructor Summary
DeleteObjectQuery()
           
DeleteObjectQuery(Call call)
           
DeleteObjectQuery(java.lang.Object objectToDelete)
           
 
Method Summary
protected  DatabaseQuery checkForCustomQuery(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
          INTERNAL: Check to see if a custom query should be used for this query.
 java.lang.Object executeDatabaseQuery()
          INTERNAL: Perform the work to delete an object.
protected  java.lang.Object executeInUnitOfWorkObjectLevelModifyQuery(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
          INTERNAL: Code was moved from UnitOfWork.internalExecuteQuery
protected  QueryRedirector getDefaultRedirector()
          INTERNAL: Returns the specific default redirector for this query type.
 boolean isDeleteObjectQuery()
          PUBLIC: Return if this is a delete object query.
 boolean isFullRowRequired()
          ADVANCED: Return if the full row is required by the delete query.
protected  void prepare()
          INTERNAL: Prepare the receiver for execution in a session.
protected  void prepareCustomQuery(DatabaseQuery customQuery)
          INTERNAL: Set the properties needed to be cascaded into the custom query.
 void prepareForExecution()
          INTERNAL: Prepare the receiver for execution in a session.
 void setIsFullRowRequired(boolean isFullRowRequired)
          ADVANCED: Set if the full row is required by the delete query.
 
Methods inherited from class org.eclipse.persistence.queries.ObjectLevelModifyQuery
checkDescriptor, executeInUnitOfWork, getBackupClone, getObject, getObjectChangeSet, getPrimaryKey, getReferenceClass, getReferenceClassName, isObjectLevelModifyQuery, setBackupClone, setObject, setObjectChangeSet, setPrimaryKey, toString
 
Methods inherited from class org.eclipse.persistence.queries.ModifyQuery
forceBatchStatementExecution, getModifyRow, isModifyQuery, setForceBatchStatementExecution, setModifyRow
 
Methods inherited from class org.eclipse.persistence.queries.DatabaseQuery
addArgument, addArgument, addArgument, addArgumentByTypeName, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, buildArgumentFields, buildSelectionCriteria, cacheStatement, cascadeAllParts, cascadeByMapping, cascadeOnlyDependentParts, cascadePrivateParts, checkEarlyReturn, checkPrepare, checkPrepare, clone, clonedQueryExecutionComplete, convertClassNamesToClasses, copyFromQuery, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, execute, extractRemoteResult, getAccessor, getArguments, getArgumentTypeNames, getArgumentTypes, getArgumentValues, getCall, getCascadePolicy, getDatasourceCall, getDatasourceCalls, getDescriptor, getDomainClassNounName, getDoNotRedirect, getEJBQLString, getExecutionSession, getFlushOnExecute, getHintString, getJPQLString, getName, getProperties, getProperty, getQueryMechanism, getQueryNounName, getQueryTimeout, getRedirector, getSelectionCriteria, getSensorName, getSession, getSessionName, getShouldBindAllParameters, getSourceMapping, getSQLStatement, getSQLString, getSQLStrings, getTranslatedSQLString, getTranslatedSQLStrings, getTranslationRow, hasAccessor, hasArguments, hasProperties, hasQueryMechanism, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isCascadeOfAggregateDelete, isCustomQueryUsed, isCustomSelectionQuery, isDataModifyQuery, isDataReadQuery, isDefaultPropertiesQuery, isDeleteAllQuery, isDirectReadQuery, isExecutionClone, isExpressionQuery, isInsertObjectQuery, isJPQLCallQuery, isModifyAllQuery, isNativeConnectionRequired, isObjectBuildingQuery, isObjectLevelReadQuery, isPrepared, isReadAllQuery, isReadObjectQuery, isReadQuery, isReportQuery, isSQLCallQuery, isUpdateAllQuery, isUpdateObjectQuery, isUserDefined, isValueReadQuery, isWriteObjectQuery, maintainCache, prepareCall, prepareForRemoteExecution, prepareFromQuery, redirectQuery, remoteExecute, remoteExecute, removeProperty, replaceValueHoldersIn, retrieveBypassCache, rowFromArguments, setAccessor, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setCall, setCascadePolicy, setDatasourceCall, setDescriptor, setDoNotRedirect, setEJBQLString, setExecutionSession, setFlushOnExecute, setHintString, setIsCustomQueryUsed, setIsExecutionClone, setIsNativeConnectionRequired, setIsPrepared, setIsUserDefined, setJPQLString, setName, setProperties, setProperty, setQueryMechanism, setQueryTimeout, setRedirector, setSelectionCriteria, setSession, setSessionName, setShouldBindAllParameters, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldRetrieveBypassCache, setShouldStoreBypassCache, setShouldUseWrapperPolicy, setSourceMapping, setSQLStatement, setSQLString, setTranslationRow, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeByMapping, shouldCascadeOnlyDependentParts, shouldCascadeParts, shouldCascadePrivateParts, shouldCloneCall, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldRetrieveBypassCache, shouldStoreBypassCache, shouldUseWrapperPolicy, storeBypassCache
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isFullRowRequired

protected boolean isFullRowRequired
PERF: By default only the translation row is used for deletes, the full row can be requested for custom deletes.

Constructor Detail

DeleteObjectQuery

public DeleteObjectQuery()

DeleteObjectQuery

public DeleteObjectQuery(java.lang.Object objectToDelete)

DeleteObjectQuery

public DeleteObjectQuery(Call call)
Method Detail

isFullRowRequired

public boolean isFullRowRequired()
ADVANCED: Return if the full row is required by the delete query. This can be set on custom delete queries if more than the objects primary key and version is required.


setIsFullRowRequired

public void setIsFullRowRequired(boolean isFullRowRequired)
ADVANCED: Set if the full row is required by the delete query. This can be set on custom delete queries if more than the objects primary key and version is required.


checkForCustomQuery

protected DatabaseQuery checkForCustomQuery(org.eclipse.persistence.internal.sessions.AbstractSession session,
                                            org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
INTERNAL: Check to see if a custom query should be used for this query. This is done before the query is copied and prepared/executed. null means there is none.

Overrides:
checkForCustomQuery in class DatabaseQuery

executeInUnitOfWorkObjectLevelModifyQuery

protected java.lang.Object executeInUnitOfWorkObjectLevelModifyQuery(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
                                                                     org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
                                                              throws DatabaseException,
                                                                     OptimisticLockException
INTERNAL: Code was moved from UnitOfWork.internalExecuteQuery

Overrides:
executeInUnitOfWorkObjectLevelModifyQuery in class ObjectLevelModifyQuery
Parameters:
unitOfWork -
translationRow -
Returns:
Throws:
DatabaseException
OptimisticLockException

getDefaultRedirector

protected QueryRedirector getDefaultRedirector()
INTERNAL: Returns the specific default redirector for this query type. There are numerous default query redirectors. See ClassDescriptor for their types.

Overrides:
getDefaultRedirector in class DatabaseQuery

executeDatabaseQuery

public java.lang.Object executeDatabaseQuery()
                                      throws DatabaseException,
                                             OptimisticLockException
INTERNAL: Perform the work to delete an object.

Specified by:
executeDatabaseQuery in class DatabaseQuery
Returns:
object - the object being deleted.
Throws:
DatabaseException - - an error has occurred on the database.
OptimisticLockException - - an error has occurred using the optimistic lock feature.

isDeleteObjectQuery

public boolean isDeleteObjectQuery()
PUBLIC: Return if this is a delete object query.

Overrides:
isDeleteObjectQuery in class DatabaseQuery

prepare

protected void prepare()
INTERNAL: Prepare the receiver for execution in a session.

Overrides:
prepare in class ObjectLevelModifyQuery

prepareCustomQuery

protected void prepareCustomQuery(DatabaseQuery customQuery)
INTERNAL: Set the properties needed to be cascaded into the custom query. A custom query is set by the user, or used by default to allow caching of the prepared query. In a unit of work the custom query is used directly, so this step is bypassed.

Overrides:
prepareCustomQuery in class DatabaseQuery

prepareForExecution

public void prepareForExecution()
                         throws QueryException
INTERNAL: Prepare the receiver for execution in a session. In particular, verify that the object is not null and contains a valid primary key.

Overrides:
prepareForExecution in class ObjectLevelModifyQuery
Throws:
QueryException

EclipseLink 1.2.0, build 'v20091016-r5565' API Reference