Hi,
-------------------------
I have a Company:
String companyId;
List employees;
-------------------------
And I have the Employee:
String employeeId;
String name;
String employeeStatus;
I need to build a query that find the companies with only the employees
with employeeStatus = 1;
So, I made this:
from Company c left join c.employees e
where e.employee.employeeStatus = '1';
But it return the company list with all employees (list).
Other solution is:
select c.name, ...., e.employeeStatus
from Company c left join c.employees e
where e.employee.employeeStatus = '1';
Is this the only way for this???
thanks
_________________ Tads
|