Join without association in HQL

后端 未结 4 558
时光说笑
时光说笑 2020-12-08 06:31

Lets say I have two tables(A, B) like:

A {id, a, c}
B {id, b, c}

I have also their entities. I want to write an HQL so that the result set

4条回答
  •  时光说笑
    2020-12-08 07:12

    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

提交回复
热议问题