use of com.ibatis.sqlmap.client.SqlMapClient in project camel by apache.
the class IBatisProducer method doDelete.
private void doDelete(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();
LOG.trace("Deleting: {} using statement: {}", value, statement);
result = client.delete(statement, value);
doProcessResult(exchange, result);
}
} else {
LOG.trace("Deleting using statement: {}", statement);
result = client.delete(statement);
doProcessResult(exchange, result);
}
}
use of com.ibatis.sqlmap.client.SqlMapClient in project camel by apache.
the class IBatisProducer method doInsert.
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();
LOG.trace("Inserting: {} using statement: {}", value, statement);
result = client.insert(statement, value);
doProcessResult(exchange, result);
}
} else {
LOG.trace("Inserting using statement: {}", statement);
result = client.insert(statement);
doProcessResult(exchange, result);
}
}
use of com.ibatis.sqlmap.client.SqlMapClient in project pinpoint by naver.
the class SqlMapClientIT method queryForPaginagedListShouldBeTraced.
@Test
public void queryForPaginagedListShouldBeTraced() throws Exception {
SqlMapClient sqlMapClient = new SqlMapClientImpl(super.mockSqlMapExecutorDelegate);
super.testAndVerifyQueryForPaginatedList(sqlMapClient);
}
use of com.ibatis.sqlmap.client.SqlMapClient in project pinpoint by naver.
the class SqlMapClientIT method insertShouldBeTraced.
@Test
public void insertShouldBeTraced() throws Exception {
SqlMapClient sqlMapClient = new SqlMapClientImpl(super.mockSqlMapExecutorDelegate);
super.testAndVerifyInsert(sqlMapClient);
}
use of com.ibatis.sqlmap.client.SqlMapClient in project pinpoint by naver.
the class SqlMapClientIT method queryForListShouldBeTraced.
@Test
public void queryForListShouldBeTraced() throws Exception {
SqlMapClient sqlMapClient = new SqlMapClientImpl(super.mockSqlMapExecutorDelegate);
super.testAndVerifyQueryForList(sqlMapClient);
}
Aggregations