org.springframework.batch.item.database

## Class IbatisBatchItemWriter<T>

- java.lang.Object
- - org.springframework.batch.item.database.IbatisBatchItemWriter<T>

- All Implemented Interfaces:
    ItemWriter<T>, org.springframework.beans.factory.InitializingBean

  Deprecated.
  as of Spring Batch 3.0, in favor of the native Spring Batch support in the MyBatis follow-up project (http://mybatis.github.io/spring/)

      @Deprecated
      public class IbatisBatchItemWriter<T>
      extends java.lang.Object
      implements ItemWriter<T>, org.springframework.beans.factory.InitializingBean

  `ItemWriter` that uses the batching features from SqlMapClient to execute a batch of statements for all items provided.
  The user must provide an iBATIS statement id that points to the SQL statement defined in the iBATIS SqlMap configuration.
  It is expected that `write(List)` is called inside a transaction.
  The writer is thread-safe after its properties are set (normal singleton behavior), so it can be used to write in multiple concurrent transactions.
  Note: This reader was refactored as part of Spring Batch 3.0 to use the iBatis APIs directly instead of using Spring's SqlMapClientTemplate as part of the upgrade to support Spring 4.
  Since:
    2.0
  Author:
    Thomas Risberg, Michael Minella

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.apache.commons.logging.Log` | `logger` Deprecated.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IbatisBatchItemWriter()` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterPropertiesSet()` Deprecated. Check mandatory properties - there must be an SqlMapClient and a statementId.
    `void` | `setAssertUpdates(boolean assertUpdates)` Deprecated. Public setter for the flag that determines whether an assertion is made that all items cause at least one row to be updated.
    `void` | `setDataSource(javax.sql.DataSource dataSource)` Deprecated.
    `void` | `setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)` Deprecated. Public setter for `SqlMapClient` for injection purposes.
    `void` | `setStatementId(java.lang.String statementId)` Deprecated. Public setter for the statement id identifying the statement in the SqlMap configuration file.
    `void` | `write(java.util.List<? extends T> items)` Deprecated. Process the supplied data element.

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

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

- - ### Field Detail

    - #### logger

          protected static final org.apache.commons.logging.Log logger

      Deprecated.

  - ### Constructor Detail

    - #### IbatisBatchItemWriter

          public IbatisBatchItemWriter()

      Deprecated.

  - ### Method Detail

    - #### setDataSource

          public void setDataSource(javax.sql.DataSource dataSource)

      Deprecated.

    - #### setAssertUpdates

          public void setAssertUpdates(boolean assertUpdates)

      Deprecated.
      Public setter for the flag that determines whether an assertion is made that all items cause at least one row to be updated.
      Parameters:
        `assertUpdates` - the flag to set. Defaults to true;

    - #### setSqlMapClient

          public void setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)

      Deprecated.
      Public setter for `SqlMapClient` for injection purposes.
      Parameters:
        `sqlMapClient` - the SqlMapClient

    - #### setStatementId

          public void setStatementId(java.lang.String statementId)

      Deprecated.
      Public setter for the statement id identifying the statement in the SqlMap configuration file.
      Parameters:
        `statementId` - the id for the statement

    - #### afterPropertiesSet

          public void afterPropertiesSet()

      Deprecated.
      Check mandatory properties - there must be an SqlMapClient and a statementId.
      Specified by:
        `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`

    - #### write

          public void write(java.util.List<? extends T> items)

      Deprecated.
      Description copied from interface: `ItemWriter`
      Process the supplied data element. Will not be called with any null items in normal operation.
      Specified by:
        `write` in interface `ItemWriter<T>`
      Parameters:
        `items` - items to be written