Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 337297

Summary: Incorrect result (out of foreign key) when combination of complex Primary Key and JOINED Inheritance type
Product: z_Archived Reporter: Piotr Wawrzyniak <piotr>
Component: EclipselinkAssignee: Project Inbox <eclipselink.orm-inbox>
Status: NEW --- QA Contact:
Severity: major    
Priority: P2 CC: tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=337293
Whiteboard:
Attachments:
Description Flags
The log file
none
The zipped eclipse project none

Description Piotr Wawrzyniak CLA 2011-02-16 05:59:24 EST
Build Identifier: 2.1.2.v20101206-r8635

The list of references objects contain entries not matching the foreign key. This occurs when complex primary key containing other entity and
JOINED inheritance is used. Also to enable work in this case (see bug 337293) the duplicated column definition was add in derived classes. For inheritance SINGLE TABLE work fine. As can be see in logs problems probably is cause by not full join (only part of foreign key is used).

Reproducible: Always

Steps to Reproduce:
Steps to Reproduce:
1. Create entity A
2. Create entity Parent with key based on A and int fields
3. Create entity Child with key based on A and int fields and referencing
Parent
4. Create entities ChildX and ChildY extends the Child
5. Add duplicated reference to entity A in ChildX and ChildY
6. Insert data in such structure with the same id and different A.
7. In new run read data from structure

or

1. Create DB using test.sql from the attached project (tested on PostgreSQL
9.0)
2. Run Test class in attached project
3. Rerun the test without the call of create method
Comment 1 Piotr Wawrzyniak CLA 2011-02-16 06:03:36 EST
Created attachment 189085 [details]
The log file
Comment 2 Piotr Wawrzyniak CLA 2011-02-16 06:04:59 EST
Created attachment 189086 [details]
The zipped eclipse project
Comment 3 Tom Ware CLA 2011-02-24 08:31:06 EST
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:06:23 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink