Hellow guys, I've search trough the net but still I'm failed to do a left join in HQL.
So I decided to post here hoping someone might be able to help me.
Ok, I have a very simple example here.
Let's say I have two tables, student and address table. They are mapped as Student.java
and Address.java
student table:
address table:Ok, in sql, to left join this two table you write:
select stu.studentid,stu.studentname, addr.studentaddress from
student stu
left join
address addr on (stu.studentid=addr.studentid);so I will get :
result of left joinThen how would I do that in hql?
I've seen different HQL codes on doing a left join, I tried them, but no luck for me.
I think I still need to do some kind of mapping relationship, but I dont know how?
I'm using JPA to map my class.
I will greatly appreciate your help!
Thank you in advance!