Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1096

Use single inheritance type in the hierarchy by default

    XMLWordPrintableJSON

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

          Activity

            People

              Unassigned Unassigned
              sergebg Serge Bogatyrev
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: