[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5287) hibernate cannot handle Entities with Inheritance and a Discriminator that is part of composite pk

AndyW (JIRA) noreply at atlassian.com
Thu Jun 3 01:17:35 EDT 2010


hibernate cannot handle Entities with Inheritance and a Discriminator that is part of composite pk
--------------------------------------------------------------------------------------------------

                 Key: HHH-5287
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5287
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.3.2
         Environment: Linux, JDK1.6
            Reporter: AndyW
         Attachments: jpatest_hibernate33.zip

hi,

i am using 
Hibernate Annotations 3.4.0.GA
Hibernate EntityManager 3.4.0.GA
Hibernate 3.3.2.GA
with JPA 1.0

hibernate fails to create the entities using a SINGLE_TABLE Inheritance when the Discriminator is
part of the composite primary key. I have attached a testcase. 

hibernate is expected to only create a table LADEEINHEIT_EINAUS. however it also creates
a table for each of the two entities that extend the base class and defines a DiscriminatorValue


@Entity
@DiscriminatorValue("EINGANG")
public class LadeeinheitEingaenge extends LadeeinheitEinausgaenge 

@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "LAEA_TYP", discriminatorType = DiscriminatorType.STRING)
@Table(name = "LADEEINHEIT_EINAUS")
@MappedSuperclass
public abstract class LadeeinheitEinausgaenge

i have executed the same code using EclipseLink. EclipseLink only created one table 'LADEEINHEIT_EINAUS' 
which is what i expected.


log output from the testcase:

06:59:30,017 [main] DEBUG SchemaUpdate - create table LADEEINHEIT_EINAUS (LAEA_TYP varchar(31) not null, LAEI_AUFT_AUFT_NR bigint not null, LAEI_AUFT_MAND_MAND_NR bigint not null, LAEI_LAEI_LFD_NR bigint not null, LAEA_LOCATION_CODE varchar(6), LAEA_RADIO_CALL_SIGN varchar(4), primary key (LAEA_TYP, LAEI_AUFT_AUFT_NR, LAEI_AUFT_MAND_MAND_NR, LAEI_LAEI_LFD_NR))
06:59:30,021 [main] DEBUG SchemaUpdate - create table LadeeinheitAusgaenge (LAEA_TYP varchar(10) not null, LAEI_AUFT_AUFT_NR bigint not null, LAEI_AUFT_MAND_MAND_NR bigint not null, LAEI_LAEI_LFD_NR bigint not null, LAEA_LOCATION_CODE varchar(6), LAEA_RADIO_CALL_SIGN varchar(4), primary key (LAEA_TYP, LAEI_AUFT_AUFT_NR, LAEI_AUFT_MAND_MAND_NR, LAEI_LAEI_LFD_NR))
06:59:30,022 [main] DEBUG SchemaUpdate - create table LadeeinheitEingaenge (LAEA_TYP varchar(10) not null, LAEI_AUFT_AUFT_NR bigint not null, LAEI_AUFT_MAND_MAND_NR bigint not null, LAEI_LAEI_LFD_NR bigint not null, LAEA_LOCATION_CODE varchar(6), LAEA_RADIO_CALL_SIGN varchar(4), primary key (LAEA_TYP, LAEI_AUFT_AUFT_NR, LAEI_AUFT_MAND_MAND_NR, LAEI_LAEI_LFD_NR))

cheers,
andy


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list