【发布时间】:2019-05-17 15:23:48
【问题描述】:
我有一个主键值,我想获取一条记录进行更新,所以我现在写:
AccountRecord account = db.selectFrom(ACCOUNT).
where(ACCOUNT.ID.eq(identity.getAccountId())).fetchSingle();
JOOQ 知道我的表的主键(例如它生成 onKey() 方法等) - 所以我希望得到类似的东西:
AccountRecord account = db.fetchByKey(ACCOUNT, identity.getAccountId())
但这似乎不是一回事。 有没有更简洁的方式使用 JOOQ API 来做我想做的事?
【问题讨论】: