views:

83

answers:

3

Hey,

I'm looking at the nhibernate interceptor. It seems to be able to intercept save, update and delete queries but is there anyway I can intercept a select query.

The problem I have is that I automatically want to append some additional sql filters to the executing sql statement in certain cases.

Any thoughts

Thanks Mat

+2  A: 

The interceptor framework only allows you to intercept entity operations like save, update, and delete. Queries themselves aren't intercepted, only entity operations (and selecting/viewing doesn't count).

Consider using some sort of inheritance for a set of query classes that append to your ICriteria to suit your purposes.

Jeff Zellner
A: 

I think you can accomplish that with a custom NHibernate persister; however, I'm having trouble finding examples on how you'd write one...

Doug