Return-Path: X-Original-To: apmail-cayenne-user-archive@www.apache.org Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 21164D70D for ; Fri, 7 Sep 2012 07:52:54 +0000 (UTC) Received: (qmail 86921 invoked by uid 500); 7 Sep 2012 07:52:53 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 86882 invoked by uid 500); 7 Sep 2012 07:52:53 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 86861 invoked by uid 99); 7 Sep 2012 07:52:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Sep 2012 07:52:53 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [41.193.4.188] (HELO smtpout9.voxtelecom.co.za) (41.193.4.188) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Sep 2012 07:52:45 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmMGAEamSVDEKQalgWdsb2JhbABFhR6iaZJAAQECgQciAQEWJieCIAEBAQMoCwE/DBAGDQscgQIRh3kECAWaHKF0i0kIGDBTgTqDHAOWboRtjQA X-IronPort-AV: E=Sophos;i="4.80,384,1344204000"; d="scan'208";a="482226084" Received: from unknown (HELO webmail.xsinet.co.za) ([196.41.6.165]) by smtpout.vox.co.za with ESMTP; 07 Sep 2012 09:52:23 +0200 Received: from 209.212.102.102 (SquirrelMail authenticated user dollj@xsinet.co.za) by webmail.xsinet.co.za with HTTP; Fri, 7 Sep 2012 09:52:23 +0200 (SAST) Message-ID: <7109.209.212.102.102.1347004343.squirrel@webmail.xsinet.co.za> Date: Fri, 7 Sep 2012 09:52:23 +0200 (SAST) Subject: Re: Prefetching Question From: dollj@xsinet.co.za To: user@cayenne.apache.org User-Agent: SquirrelMail/1.4.11 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Ah :-) I figured it out ... didn't know that one could 'flatten' class field attributes as well: Highlight the attribute in the class definition and click on the [I] icon (Edit Attribute). Then select the desired path. Neat ! Thanks, great stuff. > Thanks Ari, that works great. > > Say now the Paintings table or Hobbies table has a field eg: Notes > that i'm interested in. Then flattening won't work i suppose ? > > How would you prefetch then, if no prefetching is done on the original > Artist or Person query ? > > Thanks. > > >> On 6/09/12 8:54pm, dollj@xsinet.co.za wrote: >>> If for example i have the following classes: Person, Hobbies and Hobby >>> >>> Hobbies has fields: personId and hobbyId >>> >>> If no prefetching is done on the original Person query, is there a way >>> to >>> prefetch Hobby when calling getHobbies() on Person ? >> >> Just flatten the join and simplify your code: >> >> http://cayenne.apache.org/doc/flattened-relationships.html >> >> >> Ari >> >> >> >> -- >> --------------------------> >> Aristedes Maniatis >> GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A >> > > >