* Binds BatchQuery parameters to the PreparedStatement.
*/
@Override
public void bindParameters(PreparedStatement statement, BatchQuery query) throws SQLException, Exception {
UpdateBatchQuery updateBatch = (UpdateBatchQuery) query;
List<DbAttribute> qualifierAttributes = updateBatch.getQualifierAttributes();
List<DbAttribute> updatedDbAttributes = updateBatch.getUpdatedAttributes();
int len = updatedDbAttributes.size();
int parameterIndex = 1;
for (int i = 0; i < len; i++) {
Object value = query.getValue(i);
DbAttribute attribute = updatedDbAttributes.get(i);
adapter.bindParameter(statement, value, parameterIndex++, attribute.getType(), attribute.getScale());
}
for (int i = 0; i < qualifierAttributes.size(); i++) {
Object value = query.getValue(len + i);
DbAttribute attribute = qualifierAttributes.get(i);
// skip null attributes... they are translated as "IS NULL"
if (updateBatch.isNull(attribute)) {
continue;
}
adapter.bindParameter(statement, value, parameterIndex++, attribute.getType(), attribute.getScale());
}