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

Bug 363235

Summary: DeleteAllQuery fails with composite primary key in multitable case
Product: z_Archived Reporter: Andrei Ilitchev <andrei.ilitchev>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Suggested patch none

Description Andrei Ilitchev CLA 2011-11-08 17:29:21 EST
To reproduce, descriptor has to have a composite primary key and use either a secondary table, or DirectCollectionMapping or ManyToManyMapping, or OneToOne mapping with relation table.

In DeleteAll statement generated for these tables join may fail because the order of source fields differes from the order of target fields:

instead of 
TableA.pk1 = TableB.fk1 AND TableA.pk2 = Table2.fk2
may be generated:
TableA.pk1 = TableB.fk2 AND TableA.pk2 = Table2.fk1
Comment 1 Andrei Ilitchev CLA 2011-11-09 10:04:18 EST
Created attachment 206699 [details]
Suggested patch
Comment 2 Tom Ware CLA 2011-11-17 13:48:50 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 3 Andrei Ilitchev CLA 2011-11-17 13:54:23 EST
Fixed in trunk (2.4). Reviewed by Guy.
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:30:27 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink