I have 2 entities, A
and B
. They are related but I do not want to add the relationship mapping to the beans.
How can we use left outer join between A
and B
using HQL or criteria?
There are some workarounds available for this,
- Use Native SQL as told here.
- Add a relationship and use select a from A a left join a.b.
- We can do a inner join in the HQL as select * from A a, B b where a.some=b.some
I was always going back these 2 options, is there any alternative for this? Or this in not possible?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…