gpt4 book ai didi

java - Spring数据@公式计数查询

转载 作者:行者123 更新时间:2023-11-29 19:27:22 26 4
gpt4 key购买 nike

我正在尝试在@Formula(Spring boot应用程序)中使用计数查询

@Formula("select count(te.id) from task_execution te")

但是启动服务器时出现异常

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:

说我的查询中有语法错误,并且日志中打印了以下查询:

select count(te.id) from task_execution te as formula6_ from node_info nodeinfo0

我的问题是from node_info nodeinfo0来自?我的 NodeInfo 类与 TaskExecution 类没有任何关系

谢谢

最佳答案

所以解决方案是将表达式放入大括号中。该错误非常具有误导性。

关于java - Spring数据@公式计数查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42042493/

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