Using query results on relatioships

From: Bruno René Santos (brunoren..olos.pt)
Date: Wed Nov 10 2010 - 00:38:40 UTC

  • Next message: Aristedes Maniatis: "Re: Using query results on relatioships"

    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



    This archive was generated by hypermail 2.0.0 : Wed Nov 10 2010 - 00:40:19 UTC