Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363235 - DeleteAllQuery fails with composite primary key in multitable case
Summary: DeleteAllQuery fails with composite primary key in multitable case
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-08 17:29 EST by Andrei Ilitchev CLA
Modified: 2022-06-09 10:30 EDT (History)
1 user (show)

See Also:


Attachments
Suggested patch (20.64 KB, patch)
2011-11-09 10:04 EST, Andrei Ilitchev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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