Hql语句可以这样写么
这样写
from Menu a where a.parent is null and (a.permission is null or a.permission in (
select distinct b from Permission b left join b.users d where d.id = ? ,
select distinct h from Permission h left join h.depts f where f.id = ? )
)
报这个错
Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: , near line 1, column 195 [from com.luoxudong.entity.Menu a where a.parent is null and (a.permission is null or a.permission in (select distinct b from com.luoxudong.entity.Permission b left join b.users d where d.id = ? ,select distinct h from com.luoxudong.entity.Permission h left join h.depts f where f.id = ? ))]
这样写
from Menu a where a.parent is null and (a.permission is null or a.permission in (
(select distinct b from Permission b left join b.users d where d.id = ? ),
(select distinct h from Permission h left join h.depts f where f.id = ?)
)
)
报这个错
Caused by: org.hibernate.HibernateException: ordinal parameter mismatch
到底该怎么写