org.apache.cayenne.access.trans

## Class BatchQueryBuilder

- java.lang.Object
- - org.apache.cayenne.access.trans.BatchQueryBuilder

- Direct Known Subclasses:
    DeleteBatchQueryBuilder, InsertBatchQueryBuilder, LOBBatchQueryBuilder, UpdateBatchQueryBuilder

      public abstract class BatchQueryBuilder
      extends Object

  Superclass of batch query translators.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected DbAdapter` | `adapter`
    `protected String` | `trimFunction`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BatchQueryBuilder()` Deprecated. since 3.1 unused
    `BatchQueryBuilder(DbAdapter adapter)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `appendDbAttribute(StringBuffer buf, DbAttribute dbAttribute)` Appends the name of the column to the query buffer.
    `void` | `bindParameters(PreparedStatement statement, BatchQuery query)` Binds parameters for the current batch iteration to the PreparedStatement.
    `abstract String` | `createSqlString(BatchQuery batch)` Translates BatchQuery into an SQL string formatted to use in a PreparedStatement.
    `DbAdapter` | `getAdapter()`
    `List<Object>` | `getParameterValues(BatchQuery query)` Returns a list of values for the current batch iteration.
    `String` | `getTrimFunction()`
    `void` | `setAdapter(DbAdapter adapter)`
    `void` | `setTrimFunction(String string)`

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

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

- - ### Field Detail

    - #### adapter

          protected DbAdapter adapter

    - #### trimFunction

          protected String trimFunction

  - ### Constructor Detail

    - #### BatchQueryBuilder

          @Deprecated
          public BatchQueryBuilder()

      Deprecated. since 3.1 unused

    - #### BatchQueryBuilder

          public BatchQueryBuilder(DbAdapter adapter)

  - ### Method Detail

    - #### createSqlString

          public abstract String createSqlString(BatchQuery batch)
                                          throws IOException

      Translates BatchQuery into an SQL string formatted to use in a PreparedStatement.
      Throws:
        `IOException`

    - #### appendDbAttribute

          protected void appendDbAttribute(StringBuffer buf,
                                           DbAttribute dbAttribute)

      Appends the name of the column to the query buffer. Subclasses use this method to append column names in the WHERE clause, i.e. for the columns that are not being updated.

    - #### setAdapter

          public void setAdapter(DbAdapter adapter)

    - #### getAdapter

          public DbAdapter getAdapter()

    - #### getTrimFunction

          public String getTrimFunction()

    - #### setTrimFunction

          public void setTrimFunction(String string)

    - #### bindParameters

          public void bindParameters(PreparedStatement statement,
                                     BatchQuery query)
                              throws SQLException,
                                     Exception

      Binds parameters for the current batch iteration to the PreparedStatement.
      Throws:
        `SQLException`
        `Exception`
      Since:
        1.2

    - #### getParameterValues

          public List<Object> getParameterValues(BatchQuery query)

      Returns a list of values for the current batch iteration. Used primarily for logging.
      Since:
        1.2

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