0
我有一个查询,看起来像:是否休眠(HQL)支持公共表表达式
WITH SubQ AS
(SELECT elh.encntr_id, elh.location_cd
FROM encntr_loc_his elh
WHERE ...)
SELECT e.encntr_id
FROM encounter e
WHERE e.location_cd IN
(SELECT SubQ.location_cd
FROM...)
...
有在此查询其他一些细节,和的SubQ已经使用了很多。我的问题是,是否有可能把这个查询作为一个命名查询(namedquery)作为HQL?当我尝试这样做,并编译,它抛出一个错误抱怨令牌:
Jun 19, 2017 10:38:58 AM org.hibernate.hql.internal.ast.ErrorCounter reportError ERROR: line 1:1: unexpected token: WITH Jun 19, 2017 10:38:58 AM org.hibernate.hql.internal.ast.ErrorCounter reportError ERROR: line 1:1: unexpected token: WITH line 1:1: unexpected token: WITH