Java jOOQ:如何在Select查询中调用Sql用户定义函数
我必须执行Select查询,并在如何执行中调用函数?我必须编写这种类型的jOOQ查询Java jOOQ:如何在Select查询中调用Sql用户定义函数,java,sql,jooq,Java,Sql,Jooq,我必须执行Select查询,并在如何执行中调用函数?我必须编写这种类型的jOOQ查询 Select Cola,col2,Col3, f_feeAmount(arg) col4 from SomeTable 如何为此编写jOOQ代码 SelectQuery<Record> selectQueryFee = transRefundFee.selectQuery(); selectQueryFee.addSelect(AccountBillFee.ACCOUNT_BILL_FEE.A
Select Cola,col2,Col3, f_feeAmount(arg) col4 from SomeTable
如何为此编写jOOQ代码
SelectQuery<Record> selectQueryFee = transRefundFee.selectQuery();
selectQueryFee.addSelect(AccountBillFee.ACCOUNT_BILL_FEE.ACCOUNT_BILL_FEE_RSN,AccountBill.ACCOUNT_BILL.BILL_NUMBER,AccountBill.ACCOUNT_BILL.PAYMENT_OPTION);
selectQueryFee.addSelect(f_feeAmount(arg));
SelectQuery selectQueryFee=transreturnfee.SelectQuery();
选择QueryFee.addSelect(AccountBillFee.ACCOUNT\u BILL\u FEE.ACCOUNT\u BILL\u FEE\u RSN,AccountBill.ACCOUNT\u BILL.BILL\u编号,AccountBill.ACCOUNT\u BILL.PAYMENT\u选项);
选择queryfee.addSelect(f_feeaumount(arg));
但jOOQ无法识别
f_feeaument
,因为它是一个用户定义的函数。用户定义的函数是在例程
类中生成的。您可以从该类静态导入所有方法:
import static com.example.generated.Routines.*;
然后,写f_feeaumount(arg)
就可以了
另请参见jOOQ手册的这一页。您是否尝试查找教程?是的,我知道如何编写简单查询,但其功能有一些问题我认为这将有助于您了解我编辑的问题