doProcessResult(exchange, result);
}
private void doInsert(Exchange exchange) throws Exception {
SqlMapClient client = endpoint.getSqlMapClient();
Object result;
Object in = exchange.getIn().getBody();
if (in != null) {
// lets handle arrays or collections of objects
Iterator iter = ObjectHelper.createIterator(in);
while (iter.hasNext()) {
Object value = iter.next();
if (LOG.isTraceEnabled()) {
LOG.trace("Inserting: " + value + " using statement: " + statement);
}
result = client.insert(statement, value);
doProcessResult(exchange, result);
}
} else {
if (LOG.isTraceEnabled()) {
LOG.trace("Inserting using statement: " + statement);
}
result = client.insert(statement);
doProcessResult(exchange, result);
}
}