0
我希望能夠模擬在HQL以下幾點:HQL自定義在條款
select
people0_.NameFirst as col_1_0_,
people0_.NameLast as col_2_0_,
link1_.LinkValue as col_4_0_
from
people people0_
left outer join
peoplelinks peoplelink1_
on (people0_.PersonID=link1_.PersonID and link1_.LinkTypeID=1)
;
這是一個更大的SQL查詢的一部分,我只是想回到所有的人他們是否有一個與他們關聯的鏈接類型爲1的人。該人可能有一個與他們不同類型的這就是爲什麼我不能簡單地做
select
people0_.NameFirst as col_1_0_,
people0_.NameLast as col_2_0_,
link1_.LinkValue as col_4_0_
from
people people0_
left outer join
peoplelinks peoplelink1_
on people0_.PersonID=link1_.PersonID
where
link1_.LinkTypeID=1
;
有沒有寫在Hibernate中第一次查詢的方式相關聯的鏈接?