Re: Joint Prefetches

From: Tore Halset (halse..vv.ntnu.no)
Date: Fri Mar 11 2005 - 18:44:13 EST

  • Next message: Andrus Adamchik: "Re: Joint Prefetches"

    On Mar 7, 2005, at 6:44, Andrus Adamchik wrote:

    > Just finished a new feature - joint prefetches in SelectQueries. Still
    > need to document that, but at the user level it comes down to
    > "SelectQuery.addJointPrefetch()". What's good about joint prefetches:

    I have one question regarding joint prefetches:

    A has a toMany to B and B has a flattened toMany to C
    A<-->>B<<-->>C

    SelectQuery q = new SelectQuery(A.class);
    q.addJointPrefetch("bArray");
    q.addJointPrefetch("bArray.cArray");

    Cayenne issue a join query between the tree tables A, B and C.

    Looping all Bs for a given A works, but looping all Cs for a given B
    result in lots of queries.

    Am I doing something wrong? Perhaps I should mix standard prefetch and
    joint prefetch?
    A single joint prefetch from B to C works if my query-root is B.

    Regards,
      - Tore.



    This archive was generated by hypermail 2.0.0 : Fri Mar 11 2005 - 18:44:10 EST