Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
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 ...
Attachments
Issue Links
- is duplicated by
-
OPENJPA-1299 TablePerClass only inherited by the first subclass
- Open