Hi there,

I am facing a very particular use case where I roughly have to
_systematically_ filter my entity tables when NHibernate operates
against them.

In the class's mapping, the "where" attribute (see
http://nhforge.org/doc/nh/en/index.html#mapping-declaration-class
attribute (11)) is almost exactly what I am looking for: it adds the
where clause anytime NHibernate does a SELECT/UPDATE/DELETE query.
Example: as of today, if I have <class name="Car" where="Flag = 1" ...
then NH will add the WHERE Flag = 1 to the query.

The thing is that I need to change at run-time this where clause to
set it to "Flag = 2" or whatever I want it to, and without having to
rebuild the session factory (if possible).

I almost thought the Filtering (filter-def) capabilities of NH would
do the trick, but when using a filter for a class, it is not taken
into consideration when accessing this class through a reference for
instance.

In other word: I want NH to ALWAYS add a particular WHERE clause when
accessing a table for an entity (so far the where attribute would do
the trick), but I need to be able to change it at run-time from my
application, and hopefully without having to rebuild the factory.

Any ideas?

Thanks in advance!


Sylvain

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to