cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aristedes Maniatis <...@maniatis.org>
Subject Re: Using query results on relatioships
Date Wed, 10 Nov 2010 01:50:36 GMT
http://cayenne.apache.org/doc/prefetching.html


On 10/11/10 11:38 AM, Bruno René Santos wrote:
> Hello all,
>
> I have a doubt about performance on cayenne (or probably ORM's in general...).
> Imagine a table B that has a foreign key to table A and also a foreign key to
> table C. You have a query that returns 1000 A's to a form where you have a table
> that shows all B's that belong to A. Also on each row you show a field of the
> table C.
>
> What happens, logically, is that for each row a query is made to fetch the C
> object related to B, 1000 times...
>
> What do you suggest I could do to only do a query to table C and make Cayenne
> get objects from that result to populate B's relationship with C? Is there some
> simple way to do this and still maintain the proper relationship between B and
> C?
>
> Thanx
> Bruno Santos
>

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

Mime
View raw message