I am trying use correlated queries in HQL (in select clause) for the first time and I am having the problem:
My HQL Query is of type :
SELECT CMP.id ,CMP.Name, CMP.startDate, CMP.endDate, CMPTTL.impr, CMPTTL.cnImpr,(CMPTU.id.login
FROM Z CMPTU
WHERE CMPTU.id.cId=CMP.id AND CMPTU.id.login = '[email protected]')
FROM X CMP, Y CMPTTL
WHERE CMP.Status = 'L' AND CMP.id = CMPTTL.Id (+)
As per the Hibernate Documentation "HQL subqueries can occur only in the select or where clauses.Even correlated subqueries (subqueries that refer to an alias in the outer query) are allowed. "
But when i execute my HQl I have this Error
"org.hibernate.QueryException: aggregate function expected before ( in SELECT"
I have seen the selectParser of hibernate and it expects a Aggregate function whenever "(" is encountered.
Please suggest
Thanks in Advance