Community
Participate
Working Groups
Build Identifier: 2.3.0.v20110604-r9504 The JPQL query select object(emp) from Employee emp where emp.illnesses is empty creates a a native query that joins the table illness which is not good. The generated SQL is: SELECT t0.ID , t0.NAME FROM EMPLOYEE t0 WHERE ( ( SELECT COUNT(t1.ID) -- should be count(t2.employee_id) FROM employee_illness t2 , ILLNESS t1 -- ############ unnecessary inner join WHERE ( ( t2.employee_id = t0.ID ) AND ( t1.ID = t2.illness_id -- ############# unnecessary inner join ) ) ) = ? ) bind => [0] Reproducible: Always Steps to Reproduce: Please refer to the attached testcase.
Created attachment 201765 [details] Testcase
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.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink