NHibernateUtil.Initialize and Table where clause (Soft Delete)
- by Pascal
We are using NHibernate but sometimes manually load proxies using the NHibernateUtil.Initialize call. We also employ soft delete and have a "where" condition on all our mapping to tables. SQL generated by NHibernate successfully adds the where condition (i.e. DELETED IS NULL) however we notice that NHibernateUtil.Initialize does not observe the constraints of the mapping files.
i.e. None of the SQL generated by NHibernateUtil.Initialize observes our DELETED IS NULL condition.
Is there something we're missing as we would really like to employ manual loading of some entity collections when the situation demands it.
We are using FluentNhibernate for our mapping.