[英]QuerySyntaxException: Path expected for join
I have a query: 我有一个查询:
SELECT year_body.year, count(year_body.year) as toOrder
FROM YearBody year_body
LEFT JOIN session Session WITH year_body.sessionID = Session.sessionID
LEFT JOIN version appVersion WITH session.applicationVersion = appVersion.version
WHERE year_body.eventTime > :period and session.ipAddress NOT LIKE :ip and version.is_release = 1
GROUP BY (year_body.year)
ORDER BY toOrder DESC
This query works in MySQL workbench, but when I actually use it in Java I get the error: 该查询在MySQL工作台中有效,但是当我在Java中实际使用它时,出现错误:
QuerySyntaxException: Path expected for join!
I have already got through other errors by switching ON
s to WHEN
s as well as fixing mapping issues but I am not sure how to fix this problem. 我已经通过将ON
切换为WHEN
以及解决映射问题来解决其他错误,但是我不确定如何解决此问题。
我决定使用本机查询,并且在删除对象映射引用SESSION
和appVersion
后,我的代码运行良好
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.