开发者

Nhibernate hql left join

开发者 https://www.devze.com 2023-01-22 00:48 出处:网络
Is it possible to do a left join like this in Nhibernate: SELECT T.title_id, T.title, S.qty FROM titles T

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

精彩评论

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