class FeeRepository {

	public void updateFee(FeeRequest feeRequest) {
		List<Fee> fees = feeRequest.getFees();

		for (int j = 0; j < fees.size(); j += batchSize) {

			final List<Fee> batchList = fees.subList(j, j + batchSize > fees.size() ? fees.size() : j + batchSize);

			jdbcTemplate.batchUpdate(feeQueryBuilder.UPDATE_QUERY, new BatchPreparedStatementSetter() {

				@Override
				public void setValues(PreparedStatement ps, int i) throws SQLException {
					Fee fee = fees.get(i);

					ps.setString(1, fee.getFeeCriteria());
					ps.setBigDecimal(2, fee.getFee());
					ps.setLong(3, fee.getFromDate());
					ps.setLong(4, fee.getToDate());
					ps.setLong(5, new Date().getTime());
					ps.setString(6, feeRequest.getRequestInfo().getDid());
					ps.setString(7, fee.getId());
					ps.setString(8, fee.getTenantId());
				}

				@Override
				public int getBatchSize() {
					return fees.size();
				}
			});
		}
	}

}