[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[eclipselink-users] Derived Queries
|
- From: Jeremiah Johnson <bullprog3@xxxxxxxxx>
- Date: Fri, 14 Aug 2009 10:22:57 -0400
- Delivered-to: eclipselink-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=0viQ56prcKYhMmHurncg6zfVzZqRkuSdKhWmxpTHB40=; b=PwX+SwYXpJR2alKIoHAbvKLolZ+bWST3egZAezdFs+MG3TGTDQ4Cl/i+7L/mWAAYpd +MwV8MRdX8R3ssH7TgyClXeSFrMqm0wRZd3r8ovQ048c1ITjZVN7bQuER+KKRS293EkJ 5OokJWdu9hrcookMvT8Bi+wH6/ztflxqOoF/I=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=QkVH0icSt3KKqqliqSdnR69kRFhnlIqyuMzvRqlFJNlu5I6JgNwCd3DLS8tDu7c05S Uq/lHRePOluwhOPsC3mtnW7hxm1WNAtCoGtGBx1e87eJOVuNcxQxH+eq/3dfKYybgU+c u/V6qfPTdlGwQFc5mRjPvI7KpVys+mVC6Nawk=
I'm trying to write a JPQL Query that counts the number of records in
a set. I tried using a ReportQuery (with the origional JPQL) but that
has problems if the JPQL query is already returning results. The
ReportQuery tries to add the count to the results list which causes an
sql error because the other results in the origional query are not
grouped. I think I need to have something like:
select count (obj) from (select obj2 from table obj2) obj
But that does not work. Is there a way I can suppress the columns in
the ReportQuery (made from a JPQL query) that are not grouped or is
there some way to make the JPQL above work?
--
Jeremiah Johnson
Kunz Leigh & Associates
Phone: 517-488-7393