Class 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.

See Also:
Yvon Lavoie
  • Field Details

    • isFullRowRequired

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

      protected boolean usesOptimisticLocking
      Indicates whether the query should use optimistic locking.
  • Constructor Details

    • DeleteObjectQuery

      public DeleteObjectQuery()
    • DeleteObjectQuery

      public DeleteObjectQuery(Object objectToDelete)
    • DeleteObjectQuery

      public DeleteObjectQuery(Call call)
  • Method Details

    • 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.
      checkForCustomQuery in class DatabaseQuery
    • executeInUnitOfWorkObjectLevelModifyQuery

      protected 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
      executeInUnitOfWorkObjectLevelModifyQuery in class ObjectLevelModifyQuery
      unitOfWork -
      translationRow -
    • 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.
      getDefaultRedirector in class DatabaseQuery
    • executeDatabaseQuery

      public Object executeDatabaseQuery() throws DatabaseException, OptimisticLockException
      INTERNAL: Perform the work to delete an object.
      Specified by:
      executeDatabaseQuery in class DatabaseQuery
      object - the object being deleted.
      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.
      isDeleteObjectQuery in class DatabaseQuery
    • setObject

      public void setObject(Object object)
      PUBLIC: (REQUIRED) Set the object required for modification.
      setObject in class ObjectLevelModifyQuery
    • shouldUseOptimisticLocking

      protected boolean shouldUseOptimisticLocking(Object object)
      INTERNAL: Determines whether the query should use optimistic locking with the passed object.
    • usesOptimisticLocking

      public boolean usesOptimisticLocking()
      INTERNAL: Indicating whether the query should use optimistic locking.
    • prepare

      protected void prepare()
      INTERNAL: Prepare the receiver for execution in a session.
      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.
      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.
      prepareForExecution in class ObjectLevelModifyQuery