8
votes

Using Fluent NHibernate, I have succeeded in setting up a global Filter on my NHibernate session, and using it in ClassMap classes. The Filter WHERE clause is appended to queries using that map automagically as it should - as described in other posts on this forum.

Fluent NHibernate does not implement ApplyFilter<> of SubclassMap, it is only implemented for ClassMap. It was easy to do a test by adding a filter through the back door, by passing a MappingProviderStore to the SubclassMap Constructor, and adding the filter to that. Inspecting the resulting classes in the debugger shows that everything is populated identically to a ClassMap. However, not surprisingly, this didn't work.

Can someone tell me if Filters SHOULD work with SubclassMap in NHibernate itself?

Is this therefore something that might eventually be supported (e.g. by implementing SubclassMap.ApplyFilter<>) in Fluent NHibernate?

Using Fluent NHibernate 2.1, with NHibernate 3.1

1

1 Answers

0
votes

I'm supposing that fluent call apply filter the : as per this Jira Entry, at Oct 2012 the function is not yet availavle in NH.