@Test public void testQueryIn() throws Exception { TypeToken<List<Integer>> pt = new TypeToken<List<Integer>>() { }; TypeToken<List<User>> rt = new TypeToken<List<User>>() { }; String srcSql = "select * from user where id in (:1)"; AbstractOperator operator = getOperator(pt, rt, srcSql, new ArrayList<Annotation>()); operator.setJdbcOperations(new JdbcOperationsAdapter() { @Override public <T> List<T> queryForList(DataSource ds, BoundSql boundSql, ListSupplier listSupplier, RowMapper<T> rowMapper) { String sql = boundSql.getSql(); Object[] args = boundSql.getArgs().toArray(); String descSql = "select * from user where id in (?,?,?)"; assertThat(sql, equalTo(descSql)); assertThat(args.length, equalTo(3)); assertThat(args[0], equalTo((Object) 100)); assertThat(args[1], equalTo((Object) 200)); assertThat(args[2], equalTo((Object) 300)); assertThat(rowMapper.getMappedClass().equals(User.class), is(true)); return null; } }); List<Integer> ids = Arrays.asList(100, 200, 300); operator.execute(new Object[]{ids}, InvocationStat.create()); }
@Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); }
QueryOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } }
QueryOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } QueryOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); }
QueryOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } QueryOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object execute(Object[] values, InvocationStat stat); }
QueryOperator extends AbstractOperator { @Override public Object execute(Object[] values, InvocationStat stat) { InvocationContext context = invocationContextFactory.newInvocationContext(values); return execute(context, stat); } QueryOperator(ASTRootNode rootNode, MethodDescriptor md, Config config); @Override Object execute(Object[] values, InvocationStat stat);  }