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?
source share