Hello,
I am quite new in NHibernate. I wrote some simple queries for my application using HQL, but now, I need to write another one, which is very simple in SQL but I don't know how to write it using HQL.
I need to left outer join one table but constraint a join with additional condition. The query in SQL follows:
Code:
select parent.id_parent, child.id_child
from parent
left join child on child.id_parent = parent.id_parent and child.status != 'A'
But using HQL, I am only able to generate this query:
Code:
select parent.id_parent, child.id_child
from parent
left join child on child.id_parent = parent.id_parent
where child.status != 'A'
Please is it possible in any way to put the condition from WHERE clause to JOIN clause? These two queries are returning different results.
Many thanks.