Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] WHERE a.bref IS NULL or a.bref.x. = v as an OUTER JOIN

How to make a WHERE clause produce an LEFT OUTER JOIN?

 

Scenario:

 

A.bref refers to B and can be NULL.

B.x is a non-NULL field.

 

We like to write the following:

 

SELECT a.id FROM A a WHERE a.bref IS NULL or a.bref.x = v

 

The problem is that this produces an INNER JOIN between A and B.

 

We could workaround that by explicitly writing FROM A a LEFT OUTER JOIN a.bref b, but actually we wonder whether there is a different way to tell EclipseLink that the “dot” between bref.x does NOT automatically imply an INNER joint. For example, we could imagine that some annotation at a.bref might solve this?

 

Thanks!

-Markus

 

 

 


Back to the top