Henk,

I think there's no way you can map the classes as layed out by you to your 
table setup. Given that I have recently added support for polymorphism, the 
only way to go about this decently is a setup where you have three tables, one 
for Persistent classes, one for Persons and one for Addresses, wich all common 
fields going into Persistent.

Werner

-----Ursprüngliche Nachricht-----
Von: Henk van Voorthuijsen [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 08. August 2005 15:45
An: [email protected]
Betreff: [castor-user] [JDO] How to handle subclassing to common fields?


Given the following set of classes (assume the appropriate getter/ 
setter methods):

abstract class Persistent
{
     String _entryName;
     Date _entryDate
}
class Person extends Persistent
{
     String personId
     String _firstName;
     String _lastName;
}

class Address extends Persistent
{
   String addressId
     String _city;
     String _street;
}

and the following tables:
Person
{
     personid
     entryname
     entrydate
     firstname
     lastname
}
  Address
{
     addrid
     entryname
     entrydate
     city
     street
}

How do I set up a mapping without having to specify the common fields  
for both classes?


-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------



-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to