Class ObjectLevelModifyQuery

All Implemented Interfaces:
Serializable, 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
See Also:
  • Field Details

    • primaryKey

      protected Object primaryKey
    • object

      protected Object object
    • objectChangeSet

      protected ObjectChangeSet objectChangeSet
    • backupClone

      protected Object backupClone
  • Constructor Details

    • ObjectLevelModifyQuery

      protected ObjectLevelModifyQuery()
      PUBLIC: Initialize the state of the query.
  • Method Details

    • checkDescriptor

      public void checkDescriptor(AbstractSession session) throws QueryException
      INTERNAL: Ensure that the descriptor has been set.
      Overrides:
      checkDescriptor in class DatabaseQuery
      Throws:
      QueryException
    • executeInUnitOfWork

      public Object executeInUnitOfWork(UnitOfWorkImpl unitOfWork, AbstractRecord translationRow) throws DatabaseException
      INTERNAL: All have done is move code from UnitOfWork.internalExecuteQuery
      Overrides:
      executeInUnitOfWork in class DatabaseQuery
      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 Object executeInUnitOfWorkObjectLevelModifyQuery(UnitOfWorkImpl unitOfWork, AbstractRecord translationRow) throws DatabaseException, OptimisticLockException
      INTERNAL: This code was moved from UnitOfWork.internalExecuteQuery.
      Throws:
      DatabaseException
      OptimisticLockException
    • getBackupClone

      public Object getBackupClone()
      INTERNAL: Return the backup clone of the object from the unit of work.
    • getObject

      public Object getObject()
      PUBLIC: Return the object required for modification.
    • getObjectChangeSet

      public ObjectChangeSet getObjectChangeSet()
      PUBLIC: Return the ObjectChangeSet representing the object being changed
    • getPrimaryKey

      public Object getPrimaryKey()
      INTERNAL: Get the primary key for the query
    • getReferenceClass

      public Class<?> getReferenceClass()
      Return the domain class associated with this query.
      Overrides:
      getReferenceClass in class DatabaseQuery
    • getReferenceClassName

      public 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:
      getReferenceClassName in class DatabaseQuery
    • resetMonitorName

      public void resetMonitorName()
      INTERNAL: Return the name to use for the query in performance monitoring.
      Overrides:
      resetMonitorName in class DatabaseQuery
    • isObjectLevelModifyQuery

      public boolean isObjectLevelModifyQuery()
      PUBLIC: Return if this is an object level modify query.
      Overrides:
      isObjectLevelModifyQuery in class DatabaseQuery
    • prepare

      protected void prepare() throws QueryException
      INTERNAL: Prepare the receiver for execution in a session. In particular check that the tables on the descriptor are set.
      Overrides:
      prepare in class DatabaseQuery
      Throws:
      QueryException
    • prepareForExecution

      public void prepareForExecution() throws QueryException
      INTERNAL: Prepare the receiver for execution in a session. In particular check that the tables on the descriptor are set.
      Overrides:
      prepareForExecution in class DatabaseQuery
      Throws:
      QueryException
    • setBackupClone

      public void setBackupClone(Object backupClone)
      INTERNAL: Set the backup clone of the object from the unit of work.
    • setObject

      public void setObject(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(Object primaryKey)
      INTERNAL: Set the primary key for the query.
    • toString

      public String toString()
      Overrides:
      toString in class DatabaseQuery