NHibernate Pitfalls: Criteria and Collections of Non-Entities
This is part of a series of posts about NHibernate Pitfalls. See the entire collection here.
Criteria API – and QueryOver, for that matter, which is just a strongly-typed wrapper around Criteria – cannot work with collections of non-entities: elements, components or dictionaries. If you need to work with those, you need to use one of the other APIs – LINQ, HQL or SQL.