Outer join with a nested inner join in HQL

56 views
Skip to first unread message

Rafał Rutkowski

unread,
Mar 22, 2012, 6:43:28 AM3/22/12
to nhu...@googlegroups.com
Hi,
I'm trying to implement the following query in HQL

select <something>
from table_a
left outer join (
  table_b inner join table_c on table_c.b_id=table_b.id and <some condition on table_c>
) on table_b.a_id=table_a.id

The HQL should look something like:

from A
left join (A.Bs as b join b.C c with <some condition on c>)

but the parentheses give me an error:
NHibernate.Hql.Ast.ANTLR.QuerySyntaxException : Exception of type 'Antlr.Runtime.NoViableAltException' was thrown.
Without the parentheses it works just fine, but the results are obviously not desired.

Is there any way to have a nested inner join in HQL?

Many thanks,
Rafał


Reply all
Reply to author
Forward
0 new messages