| You are referring to an alias of a left joined table in your inner joined on clause. That's like inner joining an optional association which is null. I don't know what you expect. This is how it is defined to work. The thing that you probably want is a table group, looking like this
select a.value as a,b.value as b1,c11.value as c11 from table_a as a
left outer join (
table_b as b
inner join table_c as c11 on c11.b_pk = b.pk and c11.value = 'a_1'
) on b.a_pk = a.pk
This is not possible in JPA/Hibernate and to do that, you usually just use a left join because the DBMS will use the same query plan under the covers anyway. |