IteratorValueSource<List<Object>> ivs = (IteratorValueSource)insert.getValueSource();
List<Object>[] values = new List[ivs.getColumnCount()];
for (int i = 0; i < ivs.getColumnCount(); i++) {
values[i] = new ArrayList<Object>();
Literal literal = new Literal(values[i], insert.getColumns().get(i).getType());
literal.setMultiValued(true);
translatedComm.getPreparedValues().add(literal);
}
Iterator<List<Object>> i = ivs.getIterator();
int maxBatchSize = this.executionFactory.getMaxPreparedInsertBatchSize();
while (i.hasNext()) {
int batchSize = 0;
while (i.hasNext() && batchSize++ < maxBatchSize) {
List<Object> next = i.next();
for (int j = 0; j < ivs.getColumnCount(); j++) {
values[j].add(next.get(j));
}
}
updateCount += executePreparedBatch(translatedComm, pstatement, batchSize);
for (int j = 0; j < ivs.getColumnCount(); j++) {
values[j].clear();
}
}
succeeded = true;
return new int[updateCount];
}
}
int rowCount = 1;
for (int i = 0; i< translatedComm.getPreparedValues().size(); i++) {
Literal paramValue = (Literal)translatedComm.getPreparedValues().get(i);
if (paramValue.isMultiValued()) {
rowCount = ((List<?>)paramValue.getValue()).size();
break;
}
}
if (rowCount > 1) {
commitType = getAutoCommit(translatedComm);