title: JdbcBatchItemWriter updating last record in database
body: <p>I am facing an issue, the <code>JdbcBatchItemWriter</code> is picking the last record for update, I have created <code>ItemPrepartedStatementSetter</code> which is iterating through a Array of objects and setting up <code>preparedStatement</code>. Please provide any input, below is the code</p>
  
  <p>XML :</p>
  
  <pre><code>&lt;bean id="jdbcWriter"
      class="org.springframework.batch.item.database.JdbcBatchItemWriter"&gt;
      &lt;property name="sql"
                value="UPDATE XTABLE SET FLG = ? , LST_UPDT_DT =?
                       where CTGRY= ? AND TYPE =? AND SEQ_NBR =? AND SOURCE_KEY =?" /&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
      &lt;property name="itemPreparedStatementSetter"&gt;
          &lt;bean class="com.batch.setter.XItemPrepartedStatementSetter" /&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Class</p>
  
  <pre><code>public class XItemPrepartedStatementSetter implements
          ItemPreparedStatementSetter&lt;AggrPreference[]&gt; {
  
      @Override
      public void setValues(X[] xArr, PreparedStatement preparedStatement)
              throws SQLException {
          for (int i = 0; i &lt; xArr.length; i++) {
              X x = xArr[i];
              preparedStatement.setString(1, x.getFLG());
              preparedStatement.setTimestamp(2, x.getLST_UPDT_DT());
              preparedStatement.setString(3, x.getCTGRY());
              preparedStatement.setString(4, x.getTYPE());
              preparedStatement.setString(5, x.getSEQ_NBR());
              preparedStatement.setBigDecimal(6, x.getSOURCE_KEY());
          }
      }
  }
  </code></pre>