Reputation: 111
How to query an entity based on a composite key in Jooq? E.g.:
UserAttempts org.jooq.impl.DAOImpl.findById(Record2<UInteger, String> id)
id
is a composite key. How to use the Record2<UInteger, String>
?
Upvotes: 5
Views: 1871
Reputation: 221145
You can construct a Record2
using DSLContext.newRecord()
:
UserAttempts attempts =
dao.findById(ctx.newRecord(USER_ATTEMPTS.ID_COLUMN1, USER_ATTEMPTS.ID_COLUMN2)
.values(uint(1), "abc"));
Upvotes: 8