Operating System: All
Incorrect results are received from the following query:
Select c from Customer c, IN(c.orders) o
The result returns all customers and not the customers with orders.
The generated SQL misses a join clause for the orders relationship in Customer,
so it returns all Customers, even the ones not having any Orders.
SQL: SELECT ID, NAME, VERSION, CITY, COUNTRY_CODE, COUNTRY_NAME, COUNTRY_ID
Raising priority as this is a CTS issue. Reassigning to MB.
Started looking into this.
I changed the EJBQL compiler to call reportQuery.addNonFetchJoinedAttribute for
all variables that are defined in the FROM clause, but not used in the WHERE or
SELECT clause. This makes sure the generated SQL includes a foreign key join
clause for c.orders, such that only customers with orders are returned.