Code:
select count( elements(cat.kittens) ) from eg.Cat cat group by cat
This query use inner join
Code:
select count( elements(cat.kittens) ) from eg.Cat cat left join cat.kittens group by cat
This query generate sql like
Code:
select count(kittens2_.id) as x0_0_ from Cat cat0_ left outer join Cat kittens1_ on
cat0_.id=kittens1_.parentId, Cat kittens2_ where cat0_.id=kittens2_.parentId group by cat0_.id
Code:
select count( elements(kittens) ) from eg.Cat cat left join cat.kittens as kittens group by cat
This query does not work.
How can I do this?
Thanks in advance.