Can NHibernate be linked to two separate objects?

I need to build an HQL query that uses the same object twice, but with different constants coming from previous objects.

For instance:

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 

However, when I try to do this, I get an exception saying that I have two objects in my sentence article.

How can I express this concept in HQL?

+4
source share
1 answer

You cannot do this in HQL right now.

If the with clause is the only thing currently allowed, it is the combined object and entity from which you are connecting.

+2
source

All Articles