Using Fluent NHibernate, I managed to set up a global filter on my NHibernate session and use it in ClassMap classes. The WHERE filter clause is added to queries using this map automatically, as it should - as described in other posts on this forum.
Fluent NHibernate does not implement ApplyFilter <> of SubclassMap, it applies only to ClassMap. This was easy to do by adding a filter through the back door, passing the MappingProviderStore to the SubclassMap Constructor and adding a filter to it. Checking the received classes in the debugger shows that everything is populated identically with ClassMap. However, it is not surprising that this did not work.
Can someone tell me if filters SHOULD work with SubclassMap in NHibernate itself?
Does this mean that it can ultimately be supported (for example, by implementing SubclassMap.ApplyFilter <>) in Fluent NHibernate?
Using Fluent NHibernate 2.1, with NHibernate 3.1
filter nhibernate global fluent
Bob snyder
source share