cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aristedes Maniatis <...@maniatis.org>
Subject Re: Complex query
Date Fri, 29 Oct 2010 05:56:57 GMT
You'll need to use SQLtemplate to do this. Moving to an ORM sometimes requires a rethink on
how you structure your queries if you've always thought about them from an SQL approach, so
there isn't always a simple path to convert every bit of SQL to a Cayenne query.  There is
no real concept of a sub-select in Cayenne.

Ari


On 29/10/10 12:23 AM, Bruno René Santos wrote:
> Hello all,
>
>
>
> How can I perform a query in cayenne such as this:
>
>
>
> SELECT A, B,  C
>
>
>
> FROM (
>
>
>
> (SELECT
>
>       SUM( table1.A)  A,
>
>       SUM( table1.B)  B,
>
>        table2.C  C
>
>   FROM
>
>       Table1
>
>        INNER JOIN  table2 ON table1.fk = table2.id
>
>
>
> WHERE ...
>
>
>
>
>
> Where you do not have a rootClass to start with?
>
>
>
> Thanx
>
> Bruno
>
>
>

-- 
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Mime
View raw message