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 00A34109E9 for ; Mon, 14 Oct 2013 12:48:18 +0000 (UTC) Received: (qmail 87914 invoked by uid 500); 14 Oct 2013 12:48:17 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 87681 invoked by uid 500); 14 Oct 2013 12:48:16 -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 87672 invoked by uid 99); 14 Oct 2013 12:48:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Oct 2013 12:48:14 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of tgiaccone@gmail.com designates 209.85.223.178 as permitted sender) Received: from [209.85.223.178] (HELO mail-ie0-f178.google.com) (209.85.223.178) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Oct 2013 12:48:09 +0000 Received: by mail-ie0-f178.google.com with SMTP id to1so14985860ieb.9 for ; Mon, 14 Oct 2013 05:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=1shb0n7L6zTziIRzjTAbKbwF03n5tmuN3e1tKth+1wE=; b=J4py2P51mDeIE6aivdNtMRGDtPSTXy0H++Kla5ZSws2TZgSJol1kewFYpuelwT/KiC 4tzUssx4/05U2FS9E/XTkDjCU0jogp5XdExqbjrHKeD5F/KEDz84QId3/bJWO9r0Iiw8 SdZaK4dSGBvp3YVa99XNlp4kxlVH2Z51R/666Wq2q49kzlVqAGWtjA9yHoH5vagLdaob ep1Hdpiz/39AkuuJYfrszr9PySvF1nggz5FK28avR1f0NYY7HIRfHutWF3mM9ro3m3ls TbA5LosQ3Xc6/e/SZ/WpDTxy+LexvEwUunyHpVOHL85tQJZU+t9f8jwJFIjfJlpGMORd dMDg== X-Received: by 10.50.67.107 with SMTP id m11mr13095823igt.11.1381754868971; Mon, 14 Oct 2013 05:47:48 -0700 (PDT) Received: from [10.200.252.148] (mobile-198-228-205-009.mycingular.net. [198.228.205.9]) by mx.google.com with ESMTPSA id cy15sm20553203igc.1.2013.10.14.05.47.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Oct 2013 05:47:47 -0700 (PDT) References: <4D4EDA9C-EB1E-467E-8A2E-CFD503787B73@giaccone.org> <525B481E.4010901@maniatis.org> Mime-Version: 1.0 (1.0) In-Reply-To: <525B481E.4010901@maniatis.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <354B0C18-683B-4DA4-B9D6-55395680949C@gmail.com> Cc: "user@cayenne.apache.org" X-Mailer: iPhone Mail (11A465) From: Tony Giaccone Subject: Re: AddPrefetch Date: Mon, 14 Oct 2013 08:47:46 -0400 To: "user@cayenne.apache.org" X-Virus-Checked: Checked by ClamAV on apache.org In fact the promotion offer chain table is a table which contains keys for t= hree other tables and is used to link those three. A key in that table would= have to be all three elements and so we choose to not specify a key.=20 Tony > On Oct 13, 2013, at 9:25 PM, Aristedes Maniatis wrote: >=20 >> On 14/10/13 12:05am, Tony Giaccone wrote: >>=20 >> With the prefetch in place as I singled stepped through the code, I could= see Cayenne making the three fetches when the call was made to performQuery= . >>=20 >> This line, always returned null.=20 >>=20 >> Promotion promo =3D item.getToPromotion(); >>=20 >> It wasn't till I added the join semantics that the prefetch worked and th= e relationships where valid. My question is why? I've never had to use join= semantics to prefetch to work and I wonder what it is about this configurat= ion that requires them? >=20 >=20 > I'd hazzard a guess and say that your one-to-one mapping of the OfferChain= to Promotion is related to your issue. Are you missing a primary key in Off= erChain, instead relying on the primary key from the joined Promotion? >=20 >=20 > Ari >=20 >=20 >=20 > --=20 > --------------------------> > Aristedes Maniatis > GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A