简体   繁体   English

Jooq如何基于复合键查询实体

[英]Jooq how to query entity based on composite key

How to query an entity based on a composite key in Jooq? 如何在Jooq中基于组合键查询实体? Eg: 例如:

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

id is a composite key. id是一个组合键。 How to use the Record2<UInteger, String> ? 如何使用Record2<UInteger, String>

You can construct a Record2 using DSLContext.newRecord() : 您可以使用DSLContext.newRecord()构造一个Record2

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM