I've a class 'Employee' which has a filter defined on. The filter filters all employees with a salary less than 1000.
I also have an 'EmployeePhoneNumber' class. An employee may have many 'EmployeePhoneNumber's but each 'EmployeePhoneNumber' is connected to a single employee. (many-to-one)
When I enable the filter and query for employees: 'SELECT employee from Employee employee'. The filter works fine, and only appropriate employees with a salary more than 1000 are returned.
When I query for the inner-join between employee and employees: 'SELECT employeePhoneNumber.id, employee.id from EmployeePhoneNumber employeePhoneNumber inner join employeePhoneNumber.employee employee' . The filter doesn't work, and I get phone numbers from employees with a salary less than 1000.
How can I solve it (still using filters)?
|