Search code examples
jpajqloql

in OQL, or JQL, how do you do this type of outerjoin


Say we have two completely unrelated entities EntityX and EntityY both with column age. How do I in OQL do a join like so

select x,y from EntityX as x full outer join EntityY as y on x.age = y.age

Is this not possible?

thanks, Dean


Solution

  • full outer join should almost never be used. You should use left outer join instead which is supported by JP-QL/OQL : http://docs.jboss.org/hibernate/entitymanager/3.5/reference/en/html/queryhql.html#queryhql-joins