gpt4 book ai didi

java - jOOQ 使用Where 子句更新查询

转载 作者:行者123 更新时间:2023-11-30 04:10:38 26 4
gpt4 key购买 nike

如何在 jOOQ 中添加带有更新查询的 Where 子句?

AccountPaymentRecord aacntPaymentRec = new AccountPaymentRecord();
aacntPaymentRec.setReceiptNumber(PaymentNumberFrom);
aacntPaymentRec.setPaymentComment(ReasonFrom);
transfeeTransfer.update(aacntPaymentRec);

我还必须添加 Where 子句。怎么做?

最佳答案

由于您正在 UpdatableRecord 上进行操作,因此您可能需要遵循 what's documented here, in the manual 。另一个查找信息的地方是 jOOQ manual's sections about the UPDATE statement .

一个可能的解决方案:

对于您开始使用的代码,一种可能的解决方案是使用 DSLContext.executeUpdate(R, Condition) :

AccountPaymentRecord aacntPaymentRec = new AccountPaymentRecord();
aacntPaymentRec.setReceiptNumber(PaymentNumberFrom);
aacntPaymentRec.setPaymentComment(ReasonFrom);
DSL.using(configuration)
.executeUpdate(aacntPaymentRec, ACCOUNT_PAYMENT.ID.eq(123));

关于java - jOOQ 使用Where 子句更新查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19677682/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com