0
我試圖在子查詢中用case語句編寫一個hql查詢。子查詢中的HQL case語句
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。 任何人都可以解釋我做錯了什麼嗎?