【发布时间】:2016-10-08 06:03:02
【问题描述】:
我想在“IN”参数中提供集合/数组,但我得到了
当我使用数组时:
org.jooq.exception.SQLDialectNotSupportedException: Cannot bind ARRAY types in dialect MYSQL
当我使用列表时:
org.jooq.exception.SQLDialectNotSupportedException: Type class java.util.Arrays$ArrayList is not supported in dialect DEFAULT
这是我的普通 sql:
String sql = "SELECT SUM(foo.reply = 'Y') yes " +
"FROM foo " +
"LEFT OUTER JOIN bar " +
"ON foo.id = bar.foo_id " +
"WHERE " +
"foo.id = ? " +
"AND foo.some_id IN (?) "; //this is the part I would like to use array or list
这是我的执行方式
dslContext.fetch(sql, val(fooId), val(someIds))
.into(Summary.class);
【问题讨论】: