1 回答

TA貢獻(xiàn)1827條經(jīng)驗(yàn) 獲得超8個(gè)贊
這是為我設(shè)計(jì)的。您可以嘗試讓 jOOQ 記錄它為您生成的 SQL,并嘗試直接針對(duì)您的數(shù)據(jù)庫(kù)運(yùn)行所述 SQL。
參考:
https://www.jooq.org/doc/3.9/manual/sql-execution/logging/
https://www.jooq.org/doc/3.9/manual/sql-building/conditional-expressions/in-predicate-degree-n/
Collection<Row2<String, Integer>> field1Field2Collection = new LinkedList<>();
field1Field2Collection.add(row("1", 1));
field1Field2Collection.add(row("2", 2));
field1Field2Collection.add(row("3", 3));
Result<Record2<String, Integer>> field1Field2Results = dsl
.select(Tables.TABLE1.FIELD1, Tables.TABLE2.FIELD2)
.from(Tables.TABLE1)
.join(Tables.TABLE2).on(Tables.TABLE2.PK1.eq(Tables.TABLE1.PK1))
.where(row(Tables.TABLE1.FIELD1, Tables.TABLE2.FIELD2).in(field1Field2Collection))
.fetch();
添加回答
舉報(bào)