InsertBatchTranslator (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.access.translator.batch, class: InsertBatchTranslator

# Class InsertBatchTranslator

java.lang.Object
org.apache.cayenne.access.translator.batch.BaseBatchTranslator<InsertBatchQuery>
org.apache.cayenne.access.translator.batch.InsertBatchTranslator

All Implemented Interfaces:
  `BatchTranslator`

public class InsertBatchTranslator extends BaseBatchTranslator<InsertBatchQuery> implements BatchTranslator

Since:
  4.2

- ## Field Summary

  ### Fields inherited from class BaseBatchTranslator

  `bindings, context`
  Modifier and Type
  Field
  Description
  `protected DbAttributeBinding[]`
  `bindings`
  `protected final org.apache.cayenne.access.translator.batch.BatchTranslatorContext<InsertBatchQuery>`
  `context`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `InsertBatchTranslator(InsertBatchQuery query, DbAdapter adapter)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected boolean`
  `excludeInBatch(DbAttribute attribute)`
  `String`
  `getSql()`
  Returns SQL String that can be used to init a PreparedStatement.
  `protected boolean`
  `isNullAttribute(DbAttribute attribute)`
  `DbAttributeBinding[]`
  `updateBindings(BatchQueryRow row)`
  Updates internal bindings to be used with a given row, returning updated bindings array.

  ### Methods inherited from class BaseBatchTranslator

  `buildQualifier, doTranslate, getBindings`
  Modifier and Type
  Method
  Description
  `protected ExpressionNodeBuilder`
  `buildQualifier(List<DbAttribute> attributeList)`
  `protected String`
  `doTranslate(NodeBuilder nodeBuilder)`
  This method applies `BaseSQLTreeProcessor` to the provided SQL tree node and generates SQL string from it.
  `DbAttributeBinding[]`
  `getBindings()`

  ### Methods inherited from class Object

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

  ### Methods inherited from interface BatchTranslator

  `getBindings`
  Modifier and Type
  Method
  Description
  `DbAttributeBinding[]`
  `getBindings()`
  Returns the widest possible array of bindings for this query.

- ## Constructor Details

  - ### InsertBatchTranslator

    public InsertBatchTranslator(InsertBatchQuery query, DbAdapter adapter)

- ## Method Details

  - ### getSql

    public String getSql()
    Description copied from interface: `BatchTranslator`
    Returns SQL String that can be used to init a PreparedStatement.
    Specified by:
      `getSql` in interface `BatchTranslator`

  - ### updateBindings

    public DbAttributeBinding[] updateBindings(BatchQueryRow row)
    Description copied from interface: `BatchTranslator`
    Updates internal bindings to be used with a given row, returning updated bindings array. This method guarantees that the returned array contains the same bindings in the same order as in the array returned from `BatchTranslator.getBindings()` (but in a state corresponding to the 'row' parameter). Usually the returned array is actually the same object reused for every iteration, only with changed object state.
    Specified by:
      `updateBindings` in interface `BatchTranslator`

  - ### excludeInBatch

    protected boolean excludeInBatch(DbAttribute attribute)

  - ### isNullAttribute

    protected boolean isNullAttribute(DbAttribute attribute)
    Specified by:
      `isNullAttribute` in class `BaseBatchTranslator<InsertBatchQuery>`