Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 20556 invoked from network); 4 Jul 2004 09:28:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 4 Jul 2004 09:28:26 -0000 Received: (qmail 2789 invoked by uid 500); 4 Jul 2004 09:28:30 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 2674 invoked by uid 500); 4 Jul 2004 09:28:28 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 2629 invoked by uid 99); 4 Jul 2004 09:28:26 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.27.1) with SMTP; Sun, 04 Jul 2004 02:28:22 -0700 Received: (qmail 9956 invoked by uid 65534); 4 Jul 2004 09:27:59 -0000 Received: from adsl-62-167-37-219.adslplus.ch (EHLO [192.168.1.10]) (62.167.37.219) by mail.gmx.net (mp012) with SMTP; 04 Jul 2004 11:27:59 +0200 X-Authenticated: #15507884 Message-ID: <40E7CDC9.1080208@gmx.ch> Date: Sun, 04 Jul 2004 11:28:41 +0200 From: Jakob Braeuchi User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040616 X-Accept-Language: en-us, en MIME-Version: 1.0 To: OJB Developers List Subject: Re: [OJB275] Problem with inheritance mapped on multiple tables References: <40E74F3A.50402@apache.org> In-Reply-To: <40E74F3A.50402@apache.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N hi armin, could you please post your patch to AnonymousPersistentFieldHelper. i still get unique-key violations ? jakob Armin Waibel wrote: > Hi all, > > in AnonymousPersistentFieldHelper the class hierarchy of all super > classes was created for all classes mapped to multiple tables. All > fields from the sub-class are copied to the super class, except the PK > fields. This cause problems. > I update the tests to reproduce the problems of OJB275 (by Michael > Rosenberger). This cause all ten tests to fail, because the test now use > a composite PK (autoincrement / non-autoincrement PK) and the > non-autotincrement PK of the super classes will never be set. > > E.g. > Employee <--- Executive <--- Manager > > Assume we want to store a Manager object and we use multi mapped > inheritance, OJB will create a temporary Executive and a temporary > Employee object and then store all objects. Currently the PK values are > not passed to the super classes, thus temporary objects don't have valid > PK values. If an auto-increment PK was used a new PK was created, > non-autoincrement PK are never set ---> failures in tests. > > If we pass the PK values of the sub-class to the super classes all tests > will pass (except the odmg-api, but these failures will be caused by > odmg impl). If we store an Manager object with non-autoincrement id 21, > a Manager[21] an Executive[21] and Employee[21] will be stored to tables > MANAGER, EXECUTIVE, EMPLOYEE. > Inheritance don't need extent aware PK values (uniqueness of PK across > all involved tables). > > Any comments? side-effects when include PK values? > If you agree I will patch AnonymousPersistentFieldHelper (and patch > sequence manager too - needs tweak to support key generation of copied > PK values). > > > regards, > Armin > > --------------------------------------------------------------------- > To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org > For additional commands, e-mail: ojb-dev-help@db.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org