Why does native query works and hql query is not

Viewed 24

I got a problem with this hql query. It returns org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree Is it because there is not from in the core select? I tried to use native query and it's working correctly. Is there any workaround for this hql?

select case when exists (
    select 1 from table1 t1
    left join table2 t2 on t1.id = t2.id
    left join table3 t3 on t3.other.id = t2.other.id
    where t1.id = :id
    group by t3.column
    Having count(distinct t3.value) >1)
then false
else true
end
0 Answers
Related