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:[EMAIL PROTECTED]
Sent: Monday, August 29, 2005 5:11 PM
To: [email protected]
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 [EMAIL PROTECTED] Engineering GmbH
mailto:[EMAIL PROTECTED] 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:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!