4
我需要構建一個HQL查詢,它使用同一個實體兩次,但使用來自先前實體的不同的約束。NHibernate連接可以從兩個獨立的實體中約束嗎?
例如:
select count(distinct a.id),
count(disintct b.id),
count(distinct c.id)
from
EntityA a
left join a.Children b
left join a.Children c with c.SomeConstraint = b.SomConstraint
然而,當我嘗試這樣做,我得到一個例外,說,我有我的條款與兩個實體。
如何在HQL中表達這個概念?