HQL 意外的 AST 节点:{矢量}
我正在尝试编写一个HQL查询,以从特许经营商列表中获取属于特定组织的用户列表或任何特许经营商,但是休眠无法解析它。我不知道为什么。以下是 HQL:
from User u where
(u.parentOrganisation = :topLevelOrganisation or u.parentOrganisation in :franchisees)
and u.parentOrganisation.deleted = false
and u.active = true
这是休眠吐出的错误:
unexpected AST node: {vector} [from com.myapp.User u where (u.parentOrganisation = :topLevelOrganisation or u.parentOrganisation in :franchisees0_, :franchisees
1_, :franchisees2_) and u.parentOrganisation.deleted = false and u.active = true]. Stacktrace follows:
Message: unexpected AST node: {vector} [from com.myapp.User u where (u.parentOrganisation = :topLevelOrganisation or u.parentOrganisation in :franchisees0_, :fr
anchisees1_, :franchisees2_) and u.parentOrganisation.deleted = false and u.active = true]
如果我去掉位,所以我的查询看起来像这样:or u.parentOrganisation in :franchisees
from User u where
(u.parentOrganisation = :topLevelOrganisation)
and u.parentOrganisation.deleted = false
and u.active = true
然后它工作正常。我的语法有什么问题?为什么冬眠抱怨这个额外的条款?