The result I get is an ArrayList with one item, which is an object[] of length 2.
Using the nhibernate analyser program I found that the SQL is as follows:
(getting a single field 'name' of parent rather than the entire entity)
Code:
select
parent.name, count(*)
from
parent, child
where
parent.id=child.api_method_id
and
(((select count(*) from child child2 where parent.id=child2.parent_id)!=0 ))
(cleaned up for readability and to reflect the fake table names in my example).
That count(*) in the select clause doesn't seem right to me.
(by the way, I'm using SQLite)