Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 2920 invoked from network); 21 Feb 2008 22:22:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Feb 2008 22:22:05 -0000 Received: (qmail 72939 invoked by uid 500); 21 Feb 2008 22:22:00 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 72928 invoked by uid 99); 21 Feb 2008 22:22:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2008 14:22:00 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [212.224.30.66] (HELO service-01.spree.de) (212.224.30.66) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2008 22:21:26 +0000 Received: from [172.16.1.21] (rhein.spree.de [172.16.1.21]) (authenticated bits=0) by service-01.spree.de (8.13.4/8.13.4/Debian-3) with ESMTP id m1LMLYbW001623 for ; Thu, 21 Feb 2008 23:21:34 +0100 Message-ID: <47BDF96C.4080507@spree.de> Date: Thu, 21 Feb 2008 23:21:32 +0100 From: Michael Bouschen Organization: Tech@Spree Engineering User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: jdo-dev@db.apache.org Subject: Re: subquery: max & size() References: <15613074.post@talk.nabble.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Craig, I agree the BNF would allow the query. As I understood, the offending part is the aggregate on an expression ending in a size method call, correct? Then, the problem is not related to subqueries and we have it in JDO 2.0 already: select max(this.children.size()) from x.y.Node Do we need to restrict the use of method calls inside of aggregate expressions to better support mapping JDOQL -> SQL? Regards Michael > Hi Christiaan, > > As I read the BNF for this filter, there's nothing to prevent it. > > But you are right that it might be difficult if not impossible to > translate this into SQL. Have you tried it with your favorite database > or JDO implementation? > > Craig > > On Feb 21, 2008, at 7:14 AM, Christiaan wrote: > >> >> Hi, >> a question about subqueries. With the subquery spec, should it be >> possible >> to execute the following filter, which should return the nodes with the >> maximum children? >> >> "children.size() == (select max(node.children.size()) from x.y.Node >> node)" >> >> I am asking this since the size() is probably translated into a >> count() and >> I don't believe it is allowed to perform an aggregate on another >> aggregate >> in sql. >> >> regards, >> Christiaan >> -- >> View this message in context: >> http://www.nabble.com/subquery%3A-max---size%28%29-tp15613074p15613074.html >> >> Sent from the JDO - Development mailing list archive at Nabble.com. >> > > Craig Russell > Architect, Sun Java Enterprise System http://java.sun.com/products/jdo > 408 276-5638 mailto:Craig.Russell@sun.com > P.S. A good JDO? O, Gasp! > -- Tech@Spree Engineering GmbH Tel.: +49/(0)30/235 520-33 Buelowstr. 66 Fax.: +49/(0)30/217 520-12 10783 Berlin mailto:mbo.tech@spree.de Geschaeftsfuehrung: Martin Weber Sitz Berlin, Amtsgericht Charlottenburg, HRB 564 52