Hi, I have a query which has an intersect clause, query is something like this
String query = "select p.objID, p.UName, p.UValue from UImpl p where p.UName in ('UStatus','UType','UPriority','RName') and p.objID in ((select p.objID from UImpl p where p.UName='UPriority' and p.UValue='1') intersect (select p.objID from UImpl p where p.UName='RName' and p.UValue='1')";
getHibernateTemplate().find(query);
The query works fine when executed in DB2 control center Command editor, but when the above statement is executed, it gives an exception saying
unexpected token 'intersect'
Is intersect allowed in hibernate? if not what is the alternative?
|