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

Reply via email to