Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 7712 invoked from network); 28 Mar 2010 19:00:54 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Mar 2010 19:00:54 -0000 Received: (qmail 12843 invoked by uid 500); 28 Mar 2010 19:00:54 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 12817 invoked by uid 500); 28 Mar 2010 19:00:54 -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 12809 invoked by uid 99); 28 Mar 2010 19:00:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Mar 2010 19:00:53 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.78.103.231] (HELO vorsha.objectstyle.org) (208.78.103.231) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 28 Mar 2010 19:00:47 +0000 Received: (qmail 26647 invoked from network); 28 Mar 2010 19:00:24 -0000 Received: from unknown (HELO ?IPv6:::1?) (127.0.0.1) by localhost with SMTP; 28 Mar 2010 19:00:24 -0000 Message-Id: <5844B32B-466C-4F5D-B282-050C1997342B@objectstyle.org> From: Andrus Adamchik To: user@cayenne.apache.org In-Reply-To: <479ffcd61003280856x2733a0d6sd2164058b40edfe3@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: AUTO_PK_SUPPORT, mysql and join tables Date: Sun, 28 Mar 2010 22:00:23 +0300 References: <479ffcd61003272343n2f0fbe3ajfabc1272ae8fc255@mail.gmail.com> <479ffcd61003280856x2733a0d6sd2164058b40edfe3@mail.gmail.com> X-Mailer: Apple Mail (2.936) X-Virus-Checked: Checked by ClamAV on apache.org I just wrote a unit test, and it looks like indeed in the case of a flattened relationship with "Database-generated" PK, AUTO_PK_TABLE is accessed, although after that Cayenne does the right thing and builds a query based on an auto-incremented PK, ignoring what's returned from AUTO_PK_TABLE. So this is still a bug, albeit a minor one, not affecting the app correctness. I will open a bug report. Andrus On Mar 28, 2010, at 6:56 PM, John Armstrong wrote: > Hi Andrus, > I downgraded to 3.0M6 from RC2 a few weeks ago to troubleshoot some > problems. I tested this in both M6 and RC2 with the same results. > > I have a few other join tables that are similar and exhibit the same > behavior. > Tx! > J > > Tthe flattened relationship is defined as : > > target="USERPROJECTS" toMany="true"> > > > > target="USERPROJECTS" toMany="true"> > > > > target="PROJECT" > toMany="false"> > > > toMany="false"> > > > > On Sun, Mar 28, 2010 at 7:36 AM, Andrus Adamchik >wrote: > >> Odd. Join table with its own (non-propagated) PK should work the >> same as >> any other table. Which vesrion of Cayenne is this and are you using >> flattened relationships across the join table? >> >> Andrus >> >> >> On Mar 28, 2010, at 9:43 AM, John Armstrong wrote: >> >> Hi all, >>> I am using mysql with all database generated pks and auto_increment. >>> >>> This works fine for all tables except join tables. When accessing >>> a join >>> table cayenne tries to access the AUTO_PK_TABLE rather then >>> relying on the >>> auto_increment. >>> >>> My join tables are configured identically : >>> >>> >>> >>> >> isGenerated="true" isMandatory="true" length="10"/> >>> >>> >>> >>> >> className="com.pgi.common.Userprojects" >>> dbEntityName="USERPROJECTS"> >>> >> db-attribute-path="CREATIONDATE"/> >>> >> path="ID"/> >>> >>> >>> Any ideas? >>> >>> John- >>> >> >>