openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Serge Bogatyrev (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENJPA-1096) Use single inheritance type in the hierarchy by default
Date Wed, 20 May 2009 23:17:45 GMT
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.


Mime
View raw message