Thanks for your reply Will. I figured it out. I added [where="Active = 1"] attribute in the class mapping.
On Jan 22, 9:06 am, Will Shaver <[email protected]> wrote: > http://knol.google.com/k/fabio-maulo/nhibernate-chapter-15/1nr4enxv3d... > > Did you call > > session.EnableFilter("ActiveFilter") > > ? > > On Mon, Jan 19, 2009 at 4:54 PM, Jake J. Kim <[email protected]> wrote: > > > > > > > Hi all, > > > I'm very new to NH, and looking for a way to filter out based on > > property value. > > For example, say I have Employee class and I only want the list of > > Employees with Active = true. > > > Is there a way to accomplish this in hbm? > > > I added filter and filter-def in hbm file but it doesn't seem working. > > > <class ...> > > ... > > <property name="Active" column="Active" type="Boolean" /> > > ... > > <filter name="ActiveFilter" condition=":Active = true"/> > > ... > > </class> > > > <filter-def name="ActiveFilter"> > > <filter-param name="Active" type="Boolean"/> > > </filter-def> > > > I don't want to add criteria in code everytime I need product list. > > > Thanks.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
