Join without association in HQL

if you want to make outer join you can make sub query and manage OR operation ( it works for me ). it's make the query more complex and worst performant but works :-)


From Hibernate +5.1 version Hibernate introduced Join queries similar to SQL joins between unrelated entities.

Ex. Select a,b From Table a join Table b on a.id=b.id where condition


You have to use the cross join notation:

from A as table_a , B as table_b
where table_a.c = table_b.c

Of course there is no way to implement outer joins in this manner, so you might have some trouble if that's your case.

For the analogous case with criteria refer to: hibernate-criteria-joining-table-without-a-mapped-association