Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 86283 invoked from network); 12 Oct 2004 11:26:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 12 Oct 2004 11:26:12 -0000 Received: (qmail 28071 invoked by uid 500); 12 Oct 2004 11:26:10 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 28027 invoked by uid 500); 12 Oct 2004 11:26:10 -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 28011 invoked by uid 99); 12 Oct 2004 11:26:09 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [212.93.4.61] (HELO mxt1wpv.provinzial-online.de) (212.93.4.61) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 12 Oct 2004 04:26:08 -0700 Subject: Re: Referencing an abstract class. The next turn... To: "OJB Developers List" X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002 Message-ID: From: "Carsten =?Windows-1252?Q?Spr=E4ner=5FExt?=" Date: Tue, 12 Oct 2004 13:26:02 +0200 X-MIMETrack: Serialize by Router on NOTES_07/WPEXT/DE(Release 5.0.11 |July 24, 2002) at 12.10.2004 13:26:02 MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Armin, yes the problem description is right, but ojb behaves not as you described. At least in my test case it doesn't. I tried to use the ojbConcreteClass-Feature together with a superID from Dog to Animal. The Database contains the following data: TABLE_ZOO ID CLASS_NAME 1 db.Zoo TABLE_ANIMAL ID ZOO_ID NAME CLASS_NAME 1 1 Struppi db.Dog 2 1 Theresa db.Animal TABLE_DOG SUPER_ID BITES CLASS_NAME 1 TRUE db.Dog Loading object db.Zoo(id=1) results in the following structure: Zoo Object id=1 Collection animals = [Dog(id=1,'Struppi',null),Animal(id=2,'Theresa'),Animal(id=1,'Struppi')]; The type is OK for the first two objects but Struppi is contained two times? Also the attributes of Dog are not retrieved for Struppi. Only the attributes of Animal are. The repository is used for this test uses the ojbConcreteClass feature. If i remove this feature the result is: Zoo Object id=1 Collection animals = [Animal(id=1,'Struppi'),Animal(id=2,'Theresa'),Animal(id=1,'Struppi')]; Both times anmilas[0] is the same instance then animals[2]! If i give the TABLE_DOG a new primary key attribute ID and map this to Dog.id and make all PKs in the extend of animal unique TABLE_ANIMAL ID ZOO_ID NAME CLASS_NAME 1 1 Struppi db.Dog 3 1 Theresa db.Animal TABLE_DOG ID SUPER_ID BITES CLASS_NAME 2 1 TRUE db.Dog than the result is: Zoo Object id=1 Collection animals = [Animal(id=1,'Struppi'),Animal(id=2,'Theresa'),Dog(id=1,'Struppi','TRUE')]; This meets the requirements best. In all test cases the extend db.Dog is registered in db.Animal in the repository. Funny.... carsten P.S.: I can post you a test program if you want. --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org