nHibernate criteria - how do I implement 'having count'

Posted by AWC on Stack Overflow See other posts from Stack Overflow or by AWC
Published on 2010-05-11T08:01:07Z Indexed on 2010/05/11 8:04 UTC
Read the original article Hit count: 260

Filed under:
|
|

I have the following table structure and I want a turn the query into a NH criteria but I'm not sure how to incorporate the correct 'Projection', does anyone know how?

alt text

And the query I want to turn into a Criteria:

select ComponentId from Table_1
where [Name] = 'Contact' or [Name] = 'CurrencyPair'
group by ComponentId
having count(VersionId) = 2

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about criteria