I am using a where clause on a bag to filter a bag. Is there any way to make nhibernate insert these filter values into the database?
A:
IMHO, it is not worth trying to share a table between many-to-many relations. You can't access the boolean flags in this tables, so you can't change it from NH, except using native sql, which is not how NHibernate should be used. And it will be very very very complicated to make changes on these bags. These table is completely invisible for the object oriented point of view and completely managed by NH.
Just map it to different tables and you'll be happy. Believe me.
Stefan Steinegger
2010-06-03 12:07:15