I have a sql query which says
select case when col='city' then (select name from Table) end AliasName
from SomeOtherTable
I am unable to use subqueries in hql case-when-then expression. Is there any other method I can accomplish the same
I have a sql query which says
select case when col='city' then (select name from Table) end AliasName
from SomeOtherTable
I am unable to use subqueries in hql case-when-then expression. Is there any other method I can accomplish the same
This is a workaround rather a direct answer; create a view in database and a new class in your application. now you are free of your hql totally.
of course this link is about another question but somehow relates to yours and talks about features that are not supported in HQL or are hard to implement: Hibernate Union alternatives