Uploaded image for project: 'Hibernate ORM'
  1. HHH-6911

Read/write DiscriminatorValue from/to DiscriminatorColumn when combined with InheritanceType#JOINED

    Details

    • Last commented by a user?:
      true

      Description

      The JPA spec states that DiscriminatorColumn can be used in conjunction with JOINED inheritence. The only section that seems to deal with this combination is 11.1.10 DiscriminatorColumn Annotation where it says

      For the SINGLE_TABLE mapping strategy, and typically also for the JOINED strategy, the persistence
      provider will use a type discriminator column. The DiscriminatorColumn annotation is used to
      define the discriminator column for the SINGLE_TABLE and JOINED inheritance mapping strategies.

      Apparently this is meant to imply that even if providers do not need/use the discriminator for concrete class resolution (reading) they are still expected to write it out to the database. Dunno, thats just what we have been told

      Anyway, like I said, Hibernate itself does not need the discriminator column/value to interpret the concrete classes. However, in the interest of portability we certainly could write it out.

      Longer term we could possibly even use the DiscriminatorColumn/DiscriminatorValue (if present) instead of the SQL CASE statement thing we do now.

      See HHH-4358 Closed for the origins of this request...

        Attachments

          Issue links

            Activity

              People

              • Votes:
                12 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 12.4h
                  12.4h