Ok Guys I figured out my problem.

What I failed to mention (and didn't show in my example because I didn't think it 
would make a difference) is that A and B are in separate mapping files that are both 
included in the db-conf.  Apparently however, when using an extends relationship, 
Castor will look for the parent class (i.e. A) in the same mapping file as the child 
class (i.e. B) irregardless of the fact it will be known to castor as a whole.  I also 
tried including the mapping file for A (using the href) in the mapping file for B, and 
was unsuccessful.  

Unless this is the way it was designed, which would surprise quite a bit, I am going 
to open a bug report.

Vincent Techeira

-----Original Message-----
From: Ralf Joachim [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 4:27 AM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Loading Extended Objects


Hi,

did you take a look on castor JDO example. There is a class PC that extends class 
Product.
Take care on the implementation of class Product that implements Persistent interface 
and
overwrites jdoLoad() methode.

Ralf


----- Original Message -----
From: "Techeira, Vincent X -ND" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 13, 2003 4:31 AM
Subject: [castor-dev] Loading Extended Objects


> I have a class B extends from.  They have appropriated get/set methods.  If I store 
> an instance of B, it stores the necessary data
for A.  When I try to load B however I don't get any of the values of A.
>
> Am I missing something obvious...  Consider the code and xml below.
>
>
> class A
> {
> int id;
> String data
>
> //get/set methods
> ...
>
> }
>
> class B extends A
> {
>  String otherData;
>
> // get /set methods
> ...
> }
>
> <class auto-complete="false" name="A" access="shared" identity="id">
>         <map-to table="A" />
>         <field required="true" name="id" type="integer" >
>             <sql name="id"  type="integer"/>
>         </field>
>        <field required="true" name="data" type="string" >
>             <sql name="data"  type="varchar"/>
>         </field>
> </class>
>
> <class auto-complete="false" name="A" extends="B" access="shared" identity="id">
>         <map-to table="A" />
>         <field required="true" name="id" type="integer" >
>             <sql name="id"  type="integer"/>
>         </field>
>        <field required="true" name="otherData" type="string" >
>             <sql name="other_data"  type="varchar"/>
>         </field>
> </class>
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev
>

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to