我有一个问题:
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
此查询在MySQL工作台中有效,但当我在Java中实际使用它时,我收到错误:
QuerySyntaxException: Path expected for join!
我已经通过将ON
转换为WHEN
以及修复映射问题来解决其他错误,但我不确定如何解决此问题。
答案 0 :(得分:0)
我决定使用原生查询,删除对象映射引用SESSION
和appVersion
后,我的代码运行良好