I am sorry, you are totally right. You could emulate the LEFT JOIN semantic by using the following.
CASE WHEN c.date < a.someDate THEN a.FIELD ELSE NULLIF(1,1) END
For every usage of a field of the relation a of b (e.g. someDate) you can put that case when. Then you will properly get NULL instead of the actual value if the condition is not met.
SELECT c.id, b.id, a.someDate
FROM C c
LEFT JOIN c.b b
LEFT JOIN b.a a WITH c.date < a.someDate;
becomes
SELECT c.id, b.id, CASE WHEN c.date < a.someDate THEN a.someDate ELSE NULLIF(1,1) END
FROM C c
LEFT JOIN c.b b
LEFT JOIN b.a a
WHERE (c.date < a.someDate OR a IS NULL)
But this workaround is only a last resort. Queries that select an entity can not be emulated like that.
|