Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 72134 invoked from network); 21 Jul 2005 10:04:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Jul 2005 10:04:12 -0000 Received: (qmail 71856 invoked by uid 500); 21 Jul 2005 10:04:10 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 71831 invoked by uid 99); 21 Jul 2005 10:04:10 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2005 03:04:10 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [81.174.133.99] (HELO roobarb.ajsoft.net) (81.174.133.99) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2005 03:04:03 -0700 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by roobarb.ajsoft.net (Postfix) with ESMTP id 9FB021112A for ; Thu, 21 Jul 2005 11:04:00 +0100 (BST) From: Andy Jefferson To: jdo-dev@db.apache.org Subject: Re: equivalent mappings of join condition? Date: Thu, 21 Jul 2005 11:03:57 +0100 User-Agent: KMail/1.7.2 References: <42DECA93.1050608@sun.com> In-Reply-To: <42DECA93.1050608@sun.com> Organization: JPOX MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507211103.58544.andy@jpox.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Michelle, > Are the following mappings equivalent? They differ in the placement of > the element. Seem different to me, but since we weren't involved in the design of the ORM we only have the spec to go by here > Mapping 1: > > > > > > > > > Mapping 2: > > > > > > > > > JPOX appears to treat them differently. All in the JPOX docs :- Mapping 1 has a "Secondary Table" (spec section 15.2), which has nothing in it - well it has a Map, but the Map has no columns of its own, so the Secondary Table just has a PK. The Map in Mapping 1 is a "ForeignKey" Map (since there's no within - meaning that the keys/values are stored in the value table. See here http://www.jpox.org/docs/1_1/secondary_tables.html and here http://www.jpox.org/docs/1_1/relationships_1_N_map.html#fk_uni In Mapping 2, the Map is a "JoinTable" Map (since there's a within the ) - meaning that the Map has its key and value (or FK equivalents if the key/value are PC) stored in the join table. See here http://www.jpox.org/docs/1_1/relationships_1_N_map.html#join_pc_pc Again, this comes down to the interpretation of the within . Since JPOX (and other JDO impls for that matter) supports having Maps formed with a FK in the value, we interpret the lack of a within the as saying that we should store the linkage between map and value as a FK in the value (This is consistent with Collections where there is no within being interpreted as having a FK in the element). Criticise away ;-) It's good to see that the TCK is flushing out all possible differences of interpretation in ORM. There are so many ways of representing relationships, and JPOX supports what our users feel are the most common. -- Andy