Bug 425509 - @Inheritance(strategy = InheritanceType.JOINED) forgets part of PK in subclass
Summary: @Inheritance(strategy = InheritanceType.JOINED) forgets part of PK in subclass
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-12 15:13 EST by Florian Schoppmann CLA
Modified: 2022-06-09 10:04 EDT (History)
1 user (show)

See Also:


Attachments
Test case as Maven project. (4.42 KB, application/zip)
2014-01-12 15:13 EST, Florian Schoppmann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Schoppmann CLA 2014-01-12 15:13:06 EST
Created attachment 238894 [details]
Test case as Maven project.

Define the following three entities.

@Entity
public class Person {
    @Id long id;
    String name;
}

@Entity
@IdClass(MedicalProcedure.MedicalHistoryId.class)
@Inheritance(strategy = InheritanceType.JOINED)
public class MedicalProcedure {
    public static class MedicalHistoryId implements Serializable {
        long patient;
        long id;
    }

    @Id @ManyToOne Person patient;
    @Id long id;
}

@Entity
public class FailedMedicalProcedure extends MedicalProcedure {
    String reason;
}

EclipseLink maps FailedMedicalProcedure to a table with the following definition (PostgreSQL 9.2.1):

CREATE TABLE failedmedicalprocedure
(
  id bigint NOT NULL,
  reason character varying(255),
  CONSTRAINT failedmedicalprocedure_pkey PRIMARY KEY (id)
)

Obviously, the patient (or, rather, patient_id) column is missing.

A test case is attached as Maven project.
Comment 1 Eclipse Webmaster CLA 2022-06-09 10:04:51 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink