1
from (From FlightSchedule as a where a.route.routeId=1) as b

上面的查询有什么问题?它给了我这个错误

org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: ( near line 1, column 6 [from
 (From FlightSchedule as a where a.route.routeId=1) as b]

我试图以不同的方式编写它,但那不起作用。from我想内部查询应该评估为对象列表,并且第一个令牌应该返回相同的对象?请告诉我我做错了什么?谢谢你。

4

1 回答 1

3

你的假设是错误的。这是无效的 HQL。从文档中引用:

请注意,HQL 子查询只能出现在 select 或 where 子句中。

于 2013-10-10T21:14:07.440 回答