Class DeleteRequest.DeleteMappingConsumer

java.lang.Object
org.datanucleus.store.rdbms.request.DeleteRequest.DeleteMappingConsumer
All Implemented Interfaces:
MappingConsumer
Enclosing class:
DeleteRequest

private class DeleteRequest.DeleteMappingConsumer extends Object implements MappingConsumer
Mapping Consumer used for generating the DELETE statement for an object in a table. This statement will be of the form
 DELETE FROM table-name WHERE id1=? AND id2=?
 
or (when also performing version checks)
 DELETE FROM table-name WHERE id1=? AND id2=? AND version={oldvers}
 
  • Field Details

    • initialized

      boolean initialized
      Flag for initialisation state of the consumer.
    • where

      Where clause for the statement. Built during the consumption process.
    • paramIndex

      int paramIndex
      Current parameter index.
    • whereFields

      private List whereFields
      WHERE clause field numbers to use in identifying the record to delete.
    • oneToOneNonOwnerFields

      private List oneToOneNonOwnerFields
      Fields in a 1-1 relation with FK in the table of the other object.
    • callbackMappings

      private List<MappingCallbacks> callbackMappings
      Mapping Callbacks to invoke at deletion.
    • clr

      private final org.datanucleus.ClassLoaderResolver clr
      ClassLoaderResolver
    • cmd

      private final org.datanucleus.metadata.AbstractClassMetaData cmd
      MetaData for the class of the object
    • whereClauseConsumption

      private boolean whereClauseConsumption
  • Constructor Details

    • DeleteMappingConsumer

      public DeleteMappingConsumer(org.datanucleus.ClassLoaderResolver clr, org.datanucleus.metadata.AbstractClassMetaData cmd)
      Constructor.
      Parameters:
      clr - the ClassLoaderResolver
      cmd - AbstractClassMetaData
  • Method Details

    • setWhereClauseConsumption

      public void setWhereClauseConsumption()
    • preConsumeMapping

      public void preConsumeMapping(int highest)
      Description copied from interface: MappingConsumer
      This method is called before consuming the mappings
      Specified by:
      preConsumeMapping in interface MappingConsumer
      Parameters:
      highest - the highest number for the fields that are going to be provided in the consumer
    • consumeMapping

      public void consumeMapping(JavaTypeMapping m, org.datanucleus.metadata.AbstractMemberMetaData mmd)
      Description copied from interface: MappingConsumer
      Consumes a mapping associated to a member
      Specified by:
      consumeMapping in interface MappingConsumer
      Parameters:
      m - The Java type mapping
      mmd - MetaData for the member
    • consumeMapping

      public void consumeMapping(JavaTypeMapping m, MappingType mappingType)
      Consumes a mapping for a surrogate column (version, datastore identity, multitenancy). Never called with whereClauseConsumption=false
      Specified by:
      consumeMapping in interface MappingConsumer
      Parameters:
      m - The mapping
      mappingType - the Mapping type
    • consumeUnmappedColumn

      public void consumeUnmappedColumn(Column col)
      Consumer a column without mapping.
      Specified by:
      consumeUnmappedColumn in interface MappingConsumer
      Parameters:
      col - Column
    • getWhereFieldNumbers

      public int[] getWhereFieldNumbers()
      Accessor for the field numbers of any WHERE clause fields
      Returns:
      array of absolute WHERE clause field numbers
    • getOneToOneNonOwnerFields

      public org.datanucleus.metadata.AbstractMemberMetaData[] getOneToOneNonOwnerFields()
      All 1-1 bidirectional non-owner fields, with the FK In the other object.
      Returns:
      The fields that are 1-1 bidirectional with the FK at the other side.
    • getMappingCallBacks

      public List<MappingCallbacks> getMappingCallBacks()
      Obtain a List of mapping callbacks that will be run for this deletion.
      Returns:
      the mapping callbacks
    • getStatement

      public String getStatement()
      Accessor for the delete SQL statement.
      Returns:
      The delete SQL statement
    • getSoftDeleteStatement

      public String getSoftDeleteStatement()