Package org.apache.cayenne.query

# Class UpdateBatchQuery

java.lang.Object
org.apache.cayenne.query.BatchQuery
org.apache.cayenne.query.UpdateBatchQuery

All Implemented Interfaces:
  `Serializable`, `Query`

public class UpdateBatchQuery extends BatchQuery
Batched UPDATE query.

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected boolean`
  `usingOptimisticLocking`

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

  `dbAttributes, dbEntity, rows`

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(Map<String,Object> qualifierSnapshot, Map<String,Object> updateSnapshot)`
  Adds a parameter row to the batch.
  `void`
  `add(Map<String,Object> qualifierSnapshot, Map<String,Object> updateSnapshot, ObjectId id)`
  Adds a parameter row to the batch.
  `List<DbAttribute>`
  `getDbAttributes()`
  Returns a list of DbAttributes describing batch parameters.
  `List<DbAttribute>`
  `getQualifierAttributes()`
  `List<DbAttribute>`
  `getUpdatedAttributes()`
  `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)`

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

  `createSQLAction, getDbEntity, getMetaData, getRows, route`

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

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

- ## Field Details

  - ### usingOptimisticLocking

    protected boolean usingOptimisticLocking

- ## Constructor Details

  - ### UpdateBatchQuery

    public UpdateBatchQuery(DbEntity dbEntity, List<DbAttribute> qualifierAttributes, List<DbAttribute> updatedAttributes, Collection<String> nullQualifierNames, int batchCapacity)
    Creates new UpdateBatchQuery.
    Parameters:
      `dbEntity` - Table or view to update.
      `qualifierAttributes` - DbAttributes used in the WHERE clause.
      `updatedAttributes` - DbAttributes describing updated columns.
      `nullQualifierNames` - DbAttribute names in the WHERE clause that have null values.
      `batchCapacity` - Estimated size of the batch.

- ## Method Details

  - ### isNull

    public boolean isNull(DbAttribute attribute)
    Returns true if a given attribute always has a null value in the batch.
    Since:
      1.1

  - ### isUsingOptimisticLocking

    public boolean isUsingOptimisticLocking()
    Returns true if the batch query uses optimistic locking.
    Overrides:
      `isUsingOptimisticLocking` in class `BatchQuery`
    Since:
      1.1

  - ### setUsingOptimisticLocking

    public void setUsingOptimisticLocking(boolean usingOptimisticLocking)
    Since:
      1.1

  - ### add

    public void add(Map<String,Object> qualifierSnapshot, Map<String,Object> updateSnapshot)
    Adds a parameter row to the batch.

  - ### add

    public void add(Map<String,Object> qualifierSnapshot, Map<String,Object> updateSnapshot, ObjectId id)
    Adds a parameter row to the batch.
    Since:
      1.2

  - ### getDbAttributes

    public List<DbAttribute> getDbAttributes()
    Description copied from class: `BatchQuery`
    Returns a list of DbAttributes describing batch parameters.
    Overrides:
      `getDbAttributes` in class `BatchQuery`

  - ### getUpdatedAttributes

    public List<DbAttribute> getUpdatedAttributes()
    Since:
      1.1

  - ### getQualifierAttributes

    public List<DbAttribute> getQualifierAttributes()
    Since:
      1.1