[英]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.