public void queryWithRowHandler(final String id, final Object parameterObject, final RowHandler rowHandler) throws SQLException {
transactionManager.doInTransaction(new TransactionScope() {
public Object execute(Transaction transaction) throws SQLException {
MappedStatement ms = configuration.getMappedStatement(id);
Executor executor = transaction.getExecutor();
return executor.query(ms, wrapCollection(parameterObject), RowBounds.DEFAULT, new ResultHandler() {
public void handleResult(ResultContext context) {
rowHandler.handleRow(context.getResultObject());
}
});
}