我正在尝试在子查询中使用 case 语句编写 hql 查询。
select zr
from ZipResource zr
inner join zr.zipInflows zi
inner join zi.toInstInflows tii
inner join tii.toInstance ti
where ti.state = 'COMPLETED'
and
ti.completedDate between :dateFrom and
:dateTill
and (
case when :units is not null then
( ti.toPrototype.unit in :units) end )
order by tii.zipInflow.zipResource.name
做这样的事情是真的吗?在这个查询中,我在 case 语句中得到了 QuerySyntaxException。谁能解释我做错了什么?