db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Bouschen <mbo.t...@spree.de>
Subject Re: subquery: max & size()
Date Thu, 21 Feb 2008 22:21:32 GMT
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


Mime
View raw message