R – NHibernate mapping: one-to-many where

nhibernatenhibernate-mapping

I need to restrict a one-to-many collection by a date column with a value specified on the parent element. The 'where' attribute on set or bag looks perfect for this.

NHibernate documentation describes the 'where' attribute as being for arbitrary SQL, so am I correct in assuming that I cannot use values from the parent class here as I would in HQL and must implement my own IUserCollection instead?

Best Answer

IMHO using a filter would be better because you could write the restriction in database agnostic HQL.