[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6912) Persist discriminator values for JOINED inheritance strategy (where present)

Karsten Wutzke (JIRA) noreply at atlassian.com
Tue Dec 20 22:02:21 EST 2011


Persist discriminator values for JOINED inheritance strategy (where present)
----------------------------------------------------------------------------

                 Key: HHH-6912
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6912
             Project: Hibernate Core
          Issue Type: New Feature
          Components: core, entity-manager
    Affects Versions: 3.6.9, 4.0.0.Final
            Reporter: Karsten Wutzke


When using @Inheritance(strategy = InheritanceType.JOINED) and @DiscriminatorColumn(name = "discriminator") you would assume any JPA provider to persist the correct @DiscriminatorValue into the discriminator column. But this doesn't happen with Hibernate 4 (and before). While this is not absolutely necessary I consider this a must as anybody would expect Hibernate to persist a discriminator if mapped.

As a member of the JPA expert group expressed it:

{quote}The spec does not require an implementation to use discriminator columns to implement JOINED inheritance, however, the assumption is that if @DiscriminatorColumn is specified then it would be used, i.e. the values would be written out. We do not explicitly state that if a @DiscriminatorColumn is specified in the code it must be used, just like we don't explicitly state that if a @Column or @JoinColumn is specified the values must be stored in the table, but there is only so much that we can or should specify. At the lowest level, certain laws of physics and reason are just assumed.{quote}

Please add this small feature, it would be a lot more consistent to common expectation and SINGLE_TABLE inheritance type.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list