Bug 408766 - When using JOIN - ON Eclipselink says Bad Query if first condition comes from joined class rather than selected class.
Summary: When using JOIN - ON Eclipselink says Bad Query if first condition comes from...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P2 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-22 20:04 EDT by Raymond Billings CLA
Modified: 2022-06-09 10:22 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raymond Billings CLA 2013-05-22 20:04:50 EDT
When joining via a condition using the JOIN-ON syntax the query parser gives an error:  "java.lang.IllegalArgumentException: Bad Query" if the first condition after the WHERE is from the joined class rather than the selected class.

Example 1:  This query works:

select distinct r
from JpaRole r
join JpaRoleAction xref on (r.id=xref.roleId)
where (  
    r.id > 0 
 and xref.actionId = 21673
 )

Example 2:  This query does not work:

select distinct r
from JpaRole r
join JpaRoleAction xref on (r.id=xref.roleId)
where (  
    xref.actionId = 21673
    and r.id > 0
 )


Example 3:  This query does not work:

select distinct r
from JpaRole r
join JpaRoleAction xref on (r.id=xref.roleId)
where (  
    xref.actionId = 21673
 )
Comment 1 Tom Ware CLA 2013-06-11 09:51:26 EDT
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 2 Eclipse Webmaster CLA 2022-06-09 10:22:50 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink