I need the actual typed list in your project, so I need your llblgenproj file. Could you mail that to us please? support AT llblgen DOT com.
The problem is that your descriptions above suggest you have fields from the base class in the typed list, which would make it impossible to fix:
Employee <- Manager. Employee <- Clerk. Employee m:1 Department
Say I have a typed list with Department.Name and Manager.Name. I get a query like:
SELECT d.Name As DepartmentName, e.Name As ManagerName
FROM Department d LEFT JOIN Employee e ON d.DepartmentId = e.WorksForDepartmentId
LEFT JOIN Manager m ON e.EmployeeId = m.EmployeeId
WHERE m.EmployeeId IS NOT NULL
If I remove the where clause, Clerks also match the query. But the typedlist explicitly specifies: Manager.Name, and a Clerk is a sibling of Manager: each clerk has a row in Employee and works for a department, however they don't have a row in Manager. For each clerk, m.EmployeeId is NULL. To have the filter on the query, it will weed out the clerks as they will have a NULL for m.EmployeeId. The problem is, that managers also can have a NULL for m.EmployeeId, due to the left join. This is the problem.
It can be solved if the relationship between the entities is directly defined with the subtype. In that case, siblings won't be included in the query result. Same hierarchy, but now we'll use Manager m:1 Department, which is defined over Manager.ManagesDepartmentId -> Department.DepartmentId.
SELECT d.Name As DepartmentName, e.Name As ManagerName
FROM Department d LEFT JOIN Manager m ON d.DepartmentId = m.ManagesForDepartmentId
INNER JOIN Employee e ON e.EmployeeId = m.EmployeeId
WHERE m.EmployeeId IS NOT NULL
Here, we can remove the where clause, because due to the direct relationship between Department and Manager, it's not possible to have Clerk's show up in the query: only rows from Employee which are managers are included. Here, the where clause is actually hurting the results, so in this case it should be avoided.
If your typed list is equal to the first, it won't be solvable. If your typed list is equal to the second, it is solvable. As I can't determine from your info in this thread what it is exactly (I think it's equal to the first), I don't know whether a fix for this will help you: if it's equal to the first, a fix for this won't help you.
The point why this isn't fixed in the first place is because it's an edge case and it's a little complex to determine (with the knowledge we have now) which entities need a type filter and which entities don't. For situations like this, we wait till a point release to fix it as there's no need to fix it today (the situation is rare)