OK, My Bad.
I just needed to specify the field name in the
sub-class to be the same as the field-name in the
base class. Each class primary key can then have
different names mapped under <sql name=.

I hope we have all learned from this experience :)

Ron

-----Original Message-----
From: Ron Ridenour 
Sent: Monday, October 28, 2002 4:50 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [castor-dev] Problem in inserting table with foreign key


After a little investigation I have found that
Indeed the primary key field on the extended
class must have the same name as the primary
key field in the Base Class. :(

This is very Bad for me because I am trying
to implement a castor jdo solution on an existing
database that has extended table relations with
different column names for the same identity on
the different tables.

IMHO I see this as a shortcomming of Castor JDO. Castor
should be able to join on BaseClass.primaryKey =
SubClass.primaryKey and extract the correct name
of the column from the sub-class.

Are there any plans to fix this or is my analysis
somehow incorrect and there is something I am doing
wrong.

BTW. I have made several posts to this board and have
have not gotten any reply. If there are any active 
Committers or users out there who can speak to this
issue, Please reply.

Sincerely,

Ron

I have two Tables BaseObject and LocationObject
LocationObject extends BaseObject 
LocationObject.LocationObjectId is a primary Key for LocationObject 
and is a Foreign Key to BaseObject.BaseObjectId.

When calling data = db.load(LocationObject.class, key); I get an error stating
"Can't find BaseObjectId

Are the Primary key fields in extended classes required to be the same as
the Base class Primary Key field or am I missing something else.

Thanks

Ron

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

Reply via email to