Hi, Iam trying to write following SQL query with exists operator in HQL.
Select * from partnumber pn where exists (Select 1 from analystProduct ap where ap.partnumId = pn.objid and ap.sourceTable = "User" and ap.user_id = 1234);
In HQL i am using the following :
"from partNumber where exists elements (partnum.analystProduct)"
The above HQL code generated the SQL query correctly as : Select * from partnumber pn where exists (Select 1 from analystProduct ap where ap.partnumId = pn.objid );
However, I need to append an "WHERE CLAUSE" to the inner query in exists (and ap.sourceTable = "User" and ap.user_id = 1234)
Iam not sure how to do this in HQL. Can some one help?
Any suggestions or idea appreciated!!
Thanks, Puneeta
|