views:

151

answers:

1

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?

+1  A: 

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

Darin Dimitrov
Thanks for that. The reason I'd prefer not to use the filtering is the way you must globally initialize them which feels like abstraction boundaries are being blurred. BUT! preferable to IUserCollection implementation methinks :)
theGecko