You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by Michael Watzek <mw...@spree.de> on 2005/07/08 16:24:00 UTC

Company model and inheritance strategy

Hi Craig,

I'm currently preparing different inheritance mappings for hierarchies 
Person/Insurance of the company model. I think of providing separate 
configurations for the following combinations:

1) inheritance strategy:   superclass-table,
    discriminator strategy: value-map

2) inheritance strategy:   subclass-table,
    discriminator strategy: value-map

3) inheritance strategy:   new-table,
    discriminator strategy: value-map

4) inheritance strategy:   superclass-table,
    discriminator strategy: class-name

5) inheritance strategy:   subclass-table,
    discriminator strategy: class-name

6) inheritance strategy:   new-table,
    discriminator strategy: class-name

The idea is to provide the same strategy for all classes of a hierarchy, 
e.g all Person/Insurance classes have strategies 
superclass-table/value-map in case of 1).

Following this idea, I'm not sure if inheritance strategy 
"subclass-table" is supported with the current inheritance hierarchies 
of the company model: Due to the fact that Employee has two subclasses, 
both subclasses have to be mapped to the same table. Otherwise, the 
mapping for Employee is not clear. The same holds true for Insurance.

Does JDO support the case of a common superclass with inheritance 
strategy "subclass-table" having more than one (direct) subclasses?

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/
-------------------------------------------------------------------