开发者

Nhibernate hql left join

Is it possible to do a left join like this in Nhibernate:

SELECT T.title_id, T.title, S.qty
FROM titles T
LEFT JOIN sales S on
    T.title_id = S.title_id
    AND S.stor_id = '7131'
ORDER BY T.title

The important par开发者_开发技巧t to note is the extra clause (AND S.stor_id = '7131') in the LEFT JOIN expression.

Can I do this in Nhibernate hql or is there another way?


The answer is the with keyword, for example:

Select q FROM GeneralQuestion 
q Left Join q.QuestionResponses as qr with 
qr.ContactUid = :contactuid WHERE q.ParentUid = :audituid
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜