|
Home > Archive > Apache JDO Project > August 2005 > Patch implementing inheritance proposal - 1 of 2
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Patch implementing inheritance proposal - 1 of 2
|
|
| Michael Watzek 2005-08-24, 5:46 pm |
| Hi,
please find the attched patch implementing the inheritance proposal. I
had to break up the patch into two files:
- inheritance.patch-1of2
- inheritance.patch-2of2
You receive the second patch file in a separate mail.
Andy, Erik: JPOX only passes inheritance mapping 4. For this reason, it
makes sense that you review the mappings before we check in the patch.
Note, that all mappings use XML testdata "companyNoRelationships.xml".
These are the results for application identity:
- Inheritance mapping 1: SQL Exception: The statement was aborted
because it would have caused a duplicate key value in a unique or
primary key constraint or unique index identified by 'COMPS_PK' defined
on 'COMPANIES'.
- Inheritance mapping 2: org.jpox.metadata.InvalidMetaDataException:
Class org.apache.jdo.tck.pc.company.DentalInsurance has field
org.apache.jdo.tck.pc.company.DentalInsurance.carrier declared in
MetaData, but this field doesnt exist in the class!
- Inheritance mapping 3: org.jpox.metadata.InvalidMetaDataException:
Class "org.apache.jdo.tck.pc.company.Employee" has been specified to use
"subclass-table" inheritance strategy yet has at least one field that is
a Collection/Map. This is not currently supported by JPOX.
- Inheritance mapping 4: OK.
These are the results for datastore identity:
- Inheritance mapping 1: SQL Exception: The statement was aborted
because it would have caused a duplicate key value in a unique or
primary key constraint or unique index identified by
'SQL050824024418460' defined on 'PERSONS'.
- Inheritance mapping 2: org.jpox.metadata.InvalidMetaDataException:
Datastore-identity strategy in class
"org.apache.jdo.tck.pc.company.DentalInsurance" ("identity") is not the
same as the Datastore-Identity strategy declared in the super class(es)
("native").
- Inheritance mapping 3: org.jpox.metadata.InvalidMetaDataException:
Class "org.apache.jdo.tck.pc.company.Employee" has been specified to use
"subclass-table" inheritance strategy yet has at least one field that is
a Collection/Map. This is not currently supported by JPOX.
- Inheritance mapping 4: OK.
Regards,
Michael
--
-------------------------------------------------------------------
Michael Watzek Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de Buelowstr. 66
Tel.: ++49/30/235 520 36 10783 Berlin - Germany
Fax.: ++49/30/217 520 12 http://www.spree.de/
-------------------------------------------------------------------
| |
| Andy Jefferson 2005-08-24, 5:46 pm |
| Hi Michael,
> - Inheritance mapping 2: org.jpox.metadata.InvalidMetaDataException:
> Class org.apache.jdo.tck.pc.company.DentalInsurance has field
> org.apache.jdo.tck.pc.company.DentalInsurance.carrier declared in
> MetaData, but this field doesnt exist in the class!
You have a field in DentalInsurance called "carrier". It isn't qualified with
the superclass name. In section 18.14 of the spec (last sentence)
<spec>
Subclasses might map fields of their superclasses. In this case, the field
name is specified
as <superclass>.<superclass-field-name>.
</spec>
So JPOX's current interpretation is that you have to fully qualify it. Whether
this is necessary is open to debate but that's what the spec says
> - Inheritance mapping 3: org.jpox.metadata.InvalidMetaDataException:
> Class "org.apache.jdo.tck.pc.company.Employee" has been specified to use
> "subclass-table" inheritance strategy yet has at least one field that is
> a Collection/Map. This is not currently supported by JPOX.
Exactly. Not currently supported.
> - Inheritance mapping 2: org.jpox.metadata.InvalidMetaDataException:
> Datastore-identity strategy in class
> "org.apache.jdo.tck.pc.company.DentalInsurance" ("identity") is not the
> same as the Datastore-Identity strategy declared in the super class(es)
> ("native").
This is likely a bug in JPOX that I have a fix here for, but without the
actual classes and metadata I can't confirm that
--
Andy
| |
| Michael Watzek 2005-08-29, 5:45 pm |
| Hi Andy,
> Hi Michael,
>
>
>
>
> You have a field in DentalInsurance called "carrier". It isn't qualified with
> the superclass name. In section 18.14 of the spec (last sentence)
> <spec>
> Subclasses might map fields of their superclasses. In this case, the field
> name is specified
> as <superclass>.<superclass-field-name>.
> </spec>
> So JPOX's current interpretation is that you have to fully qualify it. Whether
> this is necessary is open to debate but that's what the spec says
I changed the ORM metadata in order to qualify fields of superclasses.
Please have a look at the ORM sections below. Is there any mistake? I
still get the same exception.
<class name="Insurance">
<inheritance strategy="subclass-table"/>
</class>
<class name="DentalInsurance" table="dentalinsurance">
<inheritance strategy="new-table"/>
<field name="Insurance.insid" column="INSID"
primary-key="true"/>
<field name="Insurance.carrier" column="CARRIER"/>
<field name="Insurance.employee" column="EMPLOYEE">
<foreign-key/>
</field>
<field name="lifetimeOrthoBenefit"
column="LIFETIME_ORTHO_BENEFIT"/>
</class>
<class name="MedicalInsurance" table="medicalinsurance">
<inheritance strategy="new-table"/>
<field name="Insurance.insid" column="INSID"
primary-key="true"/>
<field name="Insurance.carrier" column="CARRIER"/>
<field name="Insurance.employee" column="EMPLOYEE">
<foreign-key/>
</field>
<field name="planType" column="PLANTYPE"/>
</class>
Regards,
Michael
>
>
>
>
> Exactly. Not currently supported.
>
>
>
>
> This is likely a bug in JPOX that I have a fix here for, but without the
> actual classes and metadata I can't confirm that
>
>
--
-------------------------------------------------------------------
Michael Watzek Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de Buelowstr. 66
Tel.: ++49/30/235 520 36 10783 Berlin - Germany
Fax.: ++49/30/217 520 12 http://www.spree.de/
-------------------------------------------------------------------
| |
| Craig Russell 2005-08-29, 5:45 pm |
| | |
|
| Hi,
I replaced in the ORM the part that overwrites the definition for
Insurance, Dental and Medical as below and got it to work. I'm using
JPOX head.
Regards,
Erik Bengtson
-----Original Message-----
From: Craig Russell [mailto:Craig.Russell@Sun.COM]
Sent: Monday, August 29, 2005 5:11 PM
To: jdo-dev@db.apache.org
Subject: Re: Patch implementing inheritance proposal - 1 of 2
Hi,
I wonder if JPOX is expecting a fully qualified class name. I hope not,
because the rule elsewhere in JDO is that the class name is determined
by the <package> element in which it is contained. So Insurance.insid
should be fine for MedicalInsurance.
Craig
On Aug 29, 2005, at 6:22 AM, Michael Watzek wrote:
Hi Andy,
Hi Michael,
- Inheritance mapping 2: org.jpox.metadata.InvalidMetaDataException:
Class org.apache.jdo.tck.pc.company.DentalInsurance has field
org.apache.jdo.tck.pc.company.DentalInsurance.carrier declared in
MetaData, but this field doesnt exist in the class!
You have a field in DentalInsurance called "carrier". It isn't qualified
with the superclass name. In section 18.14 of the spec (last sentence)
<spec>
Subclasses might map fields of their superclasses. In this case, the
field name is specified
as <superclass>.<superclass-field-name>.
</spec>
So JPOX's current interpretation is that you have to fully qualify it.
Whether this is necessary is open to debate but that's what the spec
says
I changed the ORM metadata in order to qualify fields of superclasses.
Please have a look at the ORM sections below. Is there any mistake? I
still get the same exception.
<class name="Insurance">
<inheritance strategy="subclass-table"/>
</class>
<class name="DentalInsurance" table="dentalinsurance">
<inheritance strategy="new-table"/>
<field name="Insurance.insid" column="INSID"
primary-key="true"/>
<field name="Insurance.carrier" column="CARRIER"/>
<field name="Insurance.employee" column="EMPLOYEE">
<foreign-key/>
</field>
<field name="lifetimeOrthoBenefit"
column="LIFETIME_ORTHO_BENEFIT"/>
</class>
<class name="MedicalInsurance" table="medicalinsurance">
<inheritance strategy="new-table"/>
<field name="Insurance.insid" column="INSID"
primary-key="true"/>
<field name="Insurance.carrier" column="CARRIER"/>
<field name="Insurance.employee" column="EMPLOYEE">
<foreign-key/>
</field>
<field name="planType" column="PLANTYPE"/>
</class>
Regards,
Michael
- Inheritance mapping 3: org.jpox.metadata.InvalidMetaDataException:
Class "org.apache.jdo.tck.pc.company.Employee" has been specified to use
"subclass-table" inheritance strategy yet has at least one field that is
a Collection/Map. This is not currently supported by JPOX.
Exactly. Not currently supported.
- Inheritance mapping 2: org.jpox.metadata.InvalidMetaDataException:
Datastore-identity strategy in class
"org.apache.jdo.tck.pc.company.DentalInsurance" ("identity") is not the
same as the Datastore-Identity strategy declared in the super class(es)
("native").
This is likely a bug in JPOX that I have a fix here for, but without the
actual classes and metadata I can't confirm that
--
-------------------------------------------------------------------
Michael Watzek Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de Buelowstr. 66
Tel.: ++49/30/235 520 36 10783 Berlin - Germany
Fax.: ++49/30/217 520 12 http://www.spree.de/
-------------------------------------------------------------------
Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!
| |
| Andy Jefferson 2005-08-30, 2:45 am |
| > I replaced in the ORM the part that overwrites the definition for
> Insurance, Dental and Medical as below and got it to work. I'm using
> JPOX head.
And previous to that, I fixed an issue in CVS HEAD where the overriding field
was specified in the ORM file (rather than the JDO file which our unit test
was using). Consequently you should grab the latest JPOX build.
--
Andy
| |
| Michael Watzek 2005-08-30, 7:45 am |
| Hi Andy, Erik,
I'm using the latest JPOX build and still get exceptions for mapping 2
for both identity types:
Application identity: org.jpox.metadata.InvalidMetaDataException: Class
"org.apache.jdo.tck.pc.company.Employee" has been specified to use
"subclass-table" inheritance strategy yet has at least one field that is
a Collection/Map. This is not currently supported by JPOX.
Datastore identity: org.jpox.metadata.InvalidMetaDataException:
Datastore-identity strategy in class
"org.apache.jdo.tck.pc.company.DentalInsurance" ("identity") is not the
same as the Datastore-Identity strategy declared in the super class(es)
("native").
Please apply the inheritance patch and copy the attached ORM files to
"tck20/test/orm/<identity type>/org/apache/jdo/tck/pc/company". These
files qualify fields of superclasses, e.g. SuperClass.field. Then try
"maven -o -Djdo.tck.cfglist=inheritance2.conf installSchema
runtck.jdori". Do both identity types pass on your side?
Regards,
Michael
>
>
> And previous to that, I fixed an issue in CVS HEAD where the overriding field
> was specified in the ORM file (rather than the JDO file which our unit test
> was using). Consequently you should grab the latest JPOX build.
>
>
--
-------------------------------------------------------------------
Michael Watzek Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de Buelowstr. 66
Tel.: ++49/30/235 520 36 10783 Berlin - Germany
Fax.: ++49/30/217 520 12 http://www.spree.de/
-------------------------------------------------------------------
| |
| Andy Jefferson 2005-08-30, 7:45 am |
| Hi Michael,
> I'm using the latest JPOX build and still get exceptions for mapping 2
> for both identity types:
>
> Application identity: org.jpox.metadata.InvalidMetaDataException: Class
> "org.apache.jdo.tck.pc.company.Employee" has been specified to use
> "subclass-table" inheritance strategy yet has at least one field that is
> a Collection/Map. This is not currently supported by JPOX.
Hardly suprising since I previously said that this is not currently supported,
in the original mail. I've made some changes to enable this, but haven't yet
removed the metadata check (because I don't want all users going off and
using it yet).
My email of this morning, and Eriks' of last night, were for the issue about
overriding field specifications of superclasses.
> Please apply the inheritance patch and copy the attached ORM files to
> "tck20/test/orm/<identity type>/org/apache/jdo/tck/pc/company".
Since these are new tests, what is the problem with just checking them into
SVN ? so then we can just run the TCK when we next get a moment. Since we're
not talking about released software here, I don't see a problem with it.
I personally don't want to get into applying patches to the TCK in order to
try it - since there's only me and Erik working on JPOX core/enhancer in our
spare time, we have enough to be working on right now ;-)
--
Andy
|
|
|
|
|