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:
Serializable, Cloneable

public class DeleteObjectQuery
extends ObjectLevelModifyQuery

Purpose: Used for deleting objects.

Responsibilities: Extract primary key from object and delete it.

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

Field Summary
 
Fields inherited from class org.eclipse.persistence.queries.DatabaseQuery
BATCH_FETCH_PROPERTY, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, CascadePrivateParts, NoCascading
 
Constructor Summary
DeleteObjectQuery()
           
DeleteObjectQuery(Call call)
           
DeleteObjectQuery(Object objectToDelete)
           
 
Method Summary
 Object executeDatabaseQuery()
          INTERNAL: Perform the work to delete an object.
 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.
 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, cacheStatement, cascadeAllParts, cascadeByMapping, cascadeOnlyDependentParts, cascadePrivateParts, checkEarlyReturn, checkPrepare, checkPrepare, clone, convertClassNamesToClasses, copyFromQuery, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, execute, extractRemoteResult, getAccessor, getArguments, getArgumentTypeNames, getArgumentTypes, getArgumentValues, getBatchObjects, 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, 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, prepareFromQuery, redirectQuery, remoteExecute, removeProperty, replaceValueHoldersIn, retrieveBypassCache, rowFromArguments, setAccessor, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setBatchObjects, setCall, setCascadePolicy, setDatasourceCall, setDescriptor, setDoNotRedirect, setEJBQLString, setFlushOnExecute, setHintString, setIsExecutionClone, setIsNativeConnectionRequired, setIsPrepared, setIsUserDefined, setJPQLString, setName, setProperties, setProperty, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeleteObjectQuery

public DeleteObjectQuery()

DeleteObjectQuery

public DeleteObjectQuery(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.


executeDatabaseQuery

public 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

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