org.apache.cayenne.query

## Class DeleteBatchQuery

- java.lang.Object
- - org.apache.cayenne.query.BatchQuery
  - - org.apache.cayenne.query.DeleteBatchQuery

- All Implemented Interfaces:
    Serializable, ConfigurationNode, Query

      public class DeleteBatchQuery
      extends BatchQuery

  Batched delete query.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected List<DbAttribute>` | `dbAttributes`
    `protected List<Map>` | `qualifierSnapshots`
    `protected boolean` | `usingOptimisticLocking`

    - ### Fields inherited from class org.apache.cayenne.query.BatchQuery

      `batchIndex, dataMap, dbEntity, name`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DeleteBatchQuery(DbEntity dbEntity, Collection<DbAttribute> qualifierAttributes, Collection<String> nullQualifierNames, int batchCapacity)` Creates new DeleteBatchQuery.
    `DeleteBatchQuery(DbEntity dbEntity, int batchCapacity)` Creates new DeleteBatchQuery.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(Map dataObjectId)`
    `Map` | `getCurrentQualifier()` Returns a snapshot of the current qualifier values.
    `List<DbAttribute>` | `getDbAttributes()` Returns a list of DbAttributes describing batch parameters.
    `Collection<DbAttribute>` | `getQualifierAttributes()`
    `Object` | `getValue(int dbAttributeIndex)` Returns a value at a given index for the current batch iteration.
    `boolean` | `isNull(DbAttribute attribute)` Returns true if a given attribute always has a null value in the batch.
    `boolean` | `isUsingOptimisticLocking()` Returns true if the batch query uses optimistic locking.
    `void` | `setUsingOptimisticLocking(boolean usingOptimisticLocking)`
    `int` | `size()` Returns the number of parameter rows in a batch.

    - ### Methods inherited from class org.apache.cayenne.query.BatchQuery

      `acceptVisitor, createSQLAction, getDataMap, getDbEntity, getMetaData, getName, getObjectId, getValue, isEmpty, next, reset, route, setDataMap, setName`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### qualifierSnapshots

          protected List<Map> qualifierSnapshots

    - #### dbAttributes

          protected List<DbAttribute> dbAttributes

    - #### usingOptimisticLocking

          protected boolean usingOptimisticLocking

  - ### Constructor Detail

    - #### DeleteBatchQuery

          public DeleteBatchQuery(DbEntity dbEntity,
                                  int batchCapacity)

      Creates new DeleteBatchQuery. Used by ContextCommit.categorizeFlattenedDeletesAndCreateBatches for deleting flattenned relationships.
      Parameters:
        `dbEntity` - Table or view to delete.
        `batchCapacity` - Estimated size of the batch.

    - #### DeleteBatchQuery

          public DeleteBatchQuery(DbEntity dbEntity,
                                  Collection<DbAttribute> qualifierAttributes,
                                  Collection<String> nullQualifierNames,
                                  int batchCapacity)

      Creates new DeleteBatchQuery.
      Parameters:
        `dbEntity` - Table or view to delete.
        `qualifierAttributes` - DbAttributes used in the WHERE clause.
        `nullQualifierNames` - DbAttribute names in the WHERE clause that have null values.
        `batchCapacity` - Estimated size of the batch.

  - ### Method Detail

    - #### isNull

          public boolean isNull(DbAttribute attribute)

      Returns true if a given attribute always has a null value in the batch.
      Since:
        1.2

    - #### isUsingOptimisticLocking

          public boolean isUsingOptimisticLocking()

      Returns true if the batch query uses optimistic locking.
      Overrides:
        `isUsingOptimisticLocking` in class `BatchQuery`
      Since:
        1.2

    - #### setUsingOptimisticLocking

          public void setUsingOptimisticLocking(boolean usingOptimisticLocking)

      Since:
        1.2

    - #### getQualifierAttributes

          public Collection<DbAttribute> getQualifierAttributes()

      Since:
        3.0 (since 3.0 changed to return collection instead of a list).

    - #### getValue

          public Object getValue(int dbAttributeIndex)

      Description copied from class: `BatchQuery`
      Returns a value at a given index for the current batch iteration.
      Specified by:
        `getValue` in class `BatchQuery`

    - #### add

          public void add(Map dataObjectId)

    - #### size

          public int size()

      Description copied from class: `BatchQuery`
      Returns the number of parameter rows in a batch.
      Specified by:
        `size` in class `BatchQuery`

    - #### getDbAttributes

          public List<DbAttribute> getDbAttributes()

      Description copied from class: `BatchQuery`
      Returns a list of DbAttributes describing batch parameters.
      Specified by:
        `getDbAttributes` in class `BatchQuery`

    - #### getCurrentQualifier

          public Map getCurrentQualifier()

      Returns a snapshot of the current qualifier values.
      Since:
        1.2

Copyright © 2001–2018 Apache Cayenne. All rights reserved.