Details
Details
Assignee
Unassigned
UnassignedReporter
b
bBug Testcase Reminder (view)
Bug reports should generally be accompanied by a test case!
Bug Testcase Reminder (edit)
Bug reports should generally be accompanied by a test case!
Participants
b
Priority
Created August 22, 2011 at 2:29 AM
Updated August 22, 2011 at 2:29 AM
A simple JPQL query produces an unnecessary table join.
Please refer to the attached testcase (NetBeans project).
JPQL:
select
object(emp)
from
Employee emp
, in(emp.projects) proj
where
proj = roject
The generated native SQL is:
select
employee0_.id as id2_,
employee0_.name as name2_
from
Employee employee0_
inner join
Employee_Project projects1_
on employee0_.id=projects1_.Employee_id
inner join
Project project2_
on projects1_.projects_id=project2_.id
where
project2_.id=?
The generated SQL should have only one join, in other words the project table should not be included.
Please refer to the attached testcase if this is useful - you need to set up the required libraries.