gpt4 book ai didi

java - JPQL 意外 AST 节点 : around "coalesce"

转载 作者:太空宇宙 更新时间:2023-11-04 09:10:02 27 4
gpt4 key购买 nike

JPQL got an error : threw org.springframework.dao.InvalidDataAccessApiUsageException (org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: ( near line 3, column 48 ) select invoiceBE from InvoiceBE invoiceBE where invoiceBE.institutionId = ?1 and coalesce(invoiceBE.paidActivity.date < ?2) and invoiceBE.exportedActivity.date < ?3 order by invoiceBE.vendorInvoiceNumber asc

“合并”有任何错误吗?

我在mysql数据库中运行sql很好。

select
* from
ACQ_INVOICE invoice
where
invoice.institution_id=91475
and coalesce(invoice.`user_paid_date` < '2020-01-20', invoice.`paid_date` < '2020-01-20T16:45:40.786Z')

谢谢。

最佳答案

合并表达式看起来完全错误。

我认为不允许使用反引号来引用属性。这看起来更像 MySQL SQL 语法。

我也不完全确定 COALESCE 是否可以与 boolean 表达式一起使用。

关于java - JPQL 意外 AST 节点 : around "coalesce",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59759205/

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