Jooq如何根据复合键查询实体

Jooq how to query entity based on composite key

Jooq中如何根据组合键查询实体? 例如:

UserAttempts org.jooq.impl.DAOImpl.findById(Record2<UInteger, String> id)

id 是复合键。如何使用Record2<UInteger, String>?

您可以使用 DSLContext.newRecord():

构造一个 Record2
UserAttempts attempts =
dao.findById(ctx.newRecord(USER_ATTEMPTS.ID_COLUMN1, USER_ATTEMPTS.ID_COLUMN2)
                .values(uint(1), "abc"));