NHibernateUtil.Initialize and Table where clause (Soft Delete)

Posted by Pascal on Stack Overflow See other posts from Stack Overflow or by Pascal
Published on 2011-02-21T05:29:57Z Indexed on 2011/02/21 7:24 UTC
Read the original article Hit count: 215

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.

© Stack Overflow or respective owner

Related posts about c#

Related posts about nhibernate