tags:

views:

14

answers:

1

Hi,

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 part 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?

Thanks

Paul

+1  A: 

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
dagda1