You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Serge Bogatyrev (JIRA)" <ji...@apache.org> on 2009/05/21 01:17:45 UTC

[jira] Created: (OPENJPA-1096) Use single inheritance type in the hierarchy by default

Use single inheritance type in the hierarchy by default
-------------------------------------------------------

                 Key: OPENJPA-1096
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1096
             Project: OpenJPA
          Issue Type: Improvement
            Reporter: Serge Bogatyrev


As reported the current strategy of inheritance types mixing violates standards.
Example:


@Inheritance(strategy = TABLE_PER_CLASS) abstract class A ...

class B extends A ...

abstract class C extends A ...

class D extends C ...

class E extends C ...


For this hierarchy class "B" has its own table, but classes "D" and "E" are mapped into the same table. But all classes should be mapped with the same inheritance type declared in the *root* class. There is only one annotation @Inheritance in this hierarchy.

To get mixing of inheritance types in the same hierarchy additional @Inheritance annotations should be used. For example to declare mapping of classes "D" and "E" into the same table we should add @Inheritance annotation to class "C":


@Inheritance(strategy = TABLE_PER_CLASS) abstract class A ...

class B extends A ...

@Inheritance(strategy = SINGLE_TABLE) abstract class C extends A ...

class D extends C ...

class E extends C ...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.