c# - NHibernate Many-To-One on Joined Subclass with Filter -


I have a class setup that looks something like this:

  Public abstract class guardian {Public Virtual Bull Idealized {Received; Set; }} Public Square Children: Parents {} Public Sections Other {Public Virtual Ilkonak & lt; Child & gt; Children {receive; Set; }}  

The child has been mapped as parent with sub-class. Child is mapped as a bag of bags, a filter applies to the bag, named soft datablefilter. The filter looks like mapping:

  & lt; Filter-def name = "softDeleteableFilter" condition = "(IsDeleted = 0 or IsDeleted is Zero)" />  

The problem is that when the other. If the child is loaded, then this baby is being applied to the table on the filter, not on the parent table. Is NHibernate any way to apply filter to parent class?

Edit: Here is the parent mapping:

  & lt; Class name = "parent" & gt; & Lt; Id .. & lt; Property Name = "isedied" type = "System. Boolean" & gt; & Lt; Column name = "isted" /> & Lt; / Property & gt; & Lt; Included-sub-class name = "hair" & gt; & Lt; Key & gt; & Lt; Column name = "parent id" /> & Lt; / Key & gt; ... & lt; / Joy-Subclass & gt; & Lt; / Square & gt;  

In the end, the answer is probably not the most performance-friendly approach, but You can rewrite your filter status as a subquery:

  in ParentId (Choose from P.PrentID Parent P where p.IsDeleted = false)  


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -