I'm using NHibernate 2.0, but that really doesn't matter.
What I'm trying to do is calculate the sum of all children for a given table.
My query is:
Code:
select count(*) from Bestla.DBMap.News t1 join t1.PItem.Locales t2 where t2.Culture = 1 group by t1.ID
However, instead of working as its SQL equivalent, the query returns an array where each row is a count of children for each object, while I need the sum. So if there are 6 objects with 2 children each the result should be 12.
Can anyone provide a way this is actually supposed to be done in NHibernate?