gpt4 book ai didi

hibernate - Coldfusion HQL 查询异常 - 意外标记

转载 作者:行者123 更新时间:2023-12-02 23:34:13 24 4
gpt4 key购买 nike

Lucee 4.5.1 下,使用 Coldfusion/HQL,我收到以下错误:

Lucee 4.5.1.022 Error (org.hibernate.hql.ast.QuerySyntaxException)
Message unexpected token: : near line 1, column 88 [from League where leagueID in (select leagueID from Game where seasonID=:sid and userID:=uid and showReportYN=1) order by leagueID]
Cause org.hibernate.hql.ast.QuerySyntaxException
Stacktrace The Error Occurred in
/my/file/code.cfm: line 39
...
39: qryLeagues = ORMExecuteQuery("from League where leagueID in (select leagueID from Game where seasonID=:sid and userID:=uid and showReportYN=1) order by leagueID", {sid=url.sid, uid=request.userID});
...

它似乎与 HQL 文档相符: https://docs.jboss.org/hibernate/orm/4.3/devguide/en-US/html/ch11.html#d5e3400

而且,这篇 SO 帖子似乎也表明这是可以的: unexpected token : ( subquery hql

不确定我错过了什么......

更新#2

答案确实修复了它,但随后出现以下错误:

No data type for node: org.hibernate.hql.ast.tree.IdentNode

这是最终的工作查询(注意子查询中的类别名):

qryLeagues = ORMExecuteQuery("from League where leagueID in (select g.League.leagueID from Game g where g.Season.seasonID=:sid and g.Season.User.userID=:uid and g.League.showReportYN=1)",

最佳答案

您已将 =: 切换到第二个参数(第 88 个字符处)

and userID:=uid

应该是

and userID=:uid

首先使用=,然后使用:

关于hibernate - Coldfusion HQL 查询异常 - 意外标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33832211/

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