Suppose you have EntityA and EntityB. EntityB has an attribute of type EntityA call it "ea".
So you you want to retrieve all EntityAs (related or not with entityB) you could do this way:
select ea, b
from EntityB b
right join b.ea ea
In this way you will retrieve entityA that are related to entityB or entityA that are not related to entityB (ea == null).
In JPA 2.1 right join is not supported. Is there a way to rewrite the query without changing the side of the relation ? (Our business analysts don't want to change it).