Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Object Relational Mapping
Correlated subqueries in HQL Select Clause
Amandeep Singh Khurpal
Joined: Feb 20, 2012
Feb 20, 2012 00:36:08
I am Trying use correlated Queries in HQL (in select clause) for the first time and i am having the problem, Please help
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 = 'firstname.lastname@example.org') 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
Thanks in Advance
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: Correlated subqueries in HQL Select Clause
Possible to create this HQL equivalent using Hibernate Criteria?
ClassicQueryTranslatorFactory & Custom Functions Doesn't work?
SQL to HQL (Having issue in Left Outer Join)
How to use IN clause in HQL?
How to use IN Clause in HQL
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013