I want nHibernate to return a strongly typed list from a CreateQuery call using HQL.
We would return a strongly typed list of "MyType", but we would like to apply the aggregate function to the result set before returning it. Unfortunately, as I understand it, adding an aggregated field means that nHibernate cannot match the results with our signature type "MyType".
How do we get around this? The following query describes what we would like to return from the database, but the "feedcount" field affects the ability of nHibernate to determine the list to return.
select feedname, count(feedurl) as feedcount from rsssubscriptions group by feedurl, feedname order by feedcount desc
Presumably, the result set should be generated earlier in the sequence of events to ensure that nHibenate can infer the correct type to instantiate for each record.
thanks
source
share