Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 12673 invoked from network); 21 Apr 2005 18:21:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Apr 2005 18:21:17 -0000 Received: (qmail 91006 invoked by uid 500); 21 Apr 2005 18:21:35 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 90980 invoked by uid 500); 21 Apr 2005 18:21:34 -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 90966 invoked by uid 99); 21 Apr 2005 18:21:34 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from smtp-vbr5.xs4all.nl (HELO smtp-vbr5.xs4all.nl) (194.109.24.25) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 21 Apr 2005 11:21:34 -0700 Received: from [10.0.0.151] (fia43-22.dsl.hccnet.nl [62.251.22.43]) (authenticated bits=0) by smtp-vbr5.xs4all.nl (8.12.11/8.12.11) with ESMTP id j3LIL8vQ062520 for ; Thu, 21 Apr 2005 20:21:13 +0200 (CEST) (envelope-from mtaal@springsite.com) Message-ID: <4267DAF3.5070109@springsite.com> Date: Thu, 21 Apr 2005 18:55:15 +0200 From: Martin Taal User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: OJB Developers List Subject: Re: ojb 1.1: Discriminator-descriptor issue References: <426537A1.3040603@springsite.com> <4267EC6B.8030907@gmx.ch> In-Reply-To: <4267EC6B.8030907@gmx.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by XS4ALL Virus Scanner X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Jakob, The discriminator value is correct in case the classes are mapped to separate tables. Also in the case that the hierarchy is stored in one table then it works correctly. So only in case of the joined table it goes wrong. I can see in the ojb source code that it uses the value specified in the discriminator (or its classdescriptor) to put in the classname column (while it should use the class of the live object). It is strange that in the case everything is stored in one table that it then works correctly. Btw I am looking and testing against the 1.1 cvs branche. I gues that solving this could also help the query issue just reported by other also (and mentioned in your release notes as noted in the mailing list :-). gr. Martin Jakob Braeuchi wrote: > hi martin, > > is the discriminator also wrong when the classes are mapped to separate > tables ? > ojb has some issues with multi-mapped tables and armin is working on a > testcase. > > jakob > > Martin Taal schrieb: > >> Hi, >> When I have a class hierarchy mapped to multiple (joined) tables then I >> am not sure how to use the discriminator-descriptor. At least in the way >> I try it it doesn't work. >> An example I have a class A and its subclass B. >> A is stored in table A and the subclass part of B is stored in table >> B. So get B a join has to be made between tables A and B. >> >> In A I have a discriminator field (specified in the >> discriminator-descriptor). >> >> I store one A and one B object creating two records in the A table and >> one in the B table. This is correct. The discriminator field in the A >> table however only contains the classname of A (for both records). >> This I think is not correct, for the B record it should contain the >> classname of B. >> >> Also when I then retrieve all A objects I get two objects both of type >> A while one of the A object should actually be an instance of B. >> >> Btw, in the case that I store the classhierarchy in one table then the >> above works fine. >> >> As I am looking at the 1.1 branche I am not sure if this part is yet >> completely finished? >> Maybe also my setup maybe wrong, see the repository.xml here: >> >> >> > table="A"> >> >> > value="org.elver.store.test.testcasesimple2.A"/> >> >> > nullable="true"/> >> > primarykey="true" autoincrement="true" access="anonymous"/> >> >> >> >> >> > table="B"> >> >> > value="org.elver.store.test.testcasesimple2.B"/> >> >> > nullable="true"/> >> >> > primarykey="true" access="anonymous"/> >> >> > class-ref="org.elver.store.test.testcasesimple2.A" >> auto-retrieve="true" auto-update="true" auto-delete="true"> >> >> >> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org > For additional commands, e-mail: ojb-dev-help@db.apache.org > > > -- With Regards, Martin Taal Springsite Barchman Wuytierslaan 72b 3818 LK Amersfoort tel: +31 (0)33 462 02 07 fax: +31 (0)33 463 77 12 Mobile: +31 (0)6 288 48 943 email: mtaal@springsite.com web: www.springsite.com --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org