Hai all I am using Hibernate, java and Sql server for creating an application. And while doing this I have come across a problem where Union is not supported by HQL. For me the following code works in native SQL but it is not working when I am dealing with HQL.
SQL
select inttestid,testname
from LAB_TEST_SERVICES
where inttestid in(select inttestid from dbo.LAB_SPECIMEN_MAPPING
union select intprotestid from LAB_PROFILE_TEST_LIST)
and
inttestid not in(select inttestid from LAB_TARIFF_MAPPING);
HQL
String h = "From SERVICES_TYPE_POJO lst where lst.inttestid in(select smp.inttestid from SPECIMEN_MAPPING_POJO smp union select ptl.intprotestid from PROFILE_TEST_LIST_POJO ptl) and lst.inttestid not in(select tmp.inttestid from TARIFF_MAPPING_POJO tmp)";
Can anyone help me with changing the SQL to HQL. Thanks in advance.