I have the following FNH mapping fragment:
HasManyToMany((c) => c.Plaintiffs)
.LazyLoad()
.WithTableName("invoicePlantiff")
.WithChildKeyColumn("PersonReferenceID")
.WithParentKeyColumn("invoiceID")
.FetchType.Join();
Which produces the following HBM:
<bag name="Plaintiffs" access="iServe.Design.CslaNHibernate.CslaChildPropertyAccessor, iServe, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" lazy="true" table="invoicePlantiff">
<key column="invoiceID" />
<many-to-many column="PersonReferenceID" class="iServe.PersonReference, iServe, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" fetch="join" />
</bag>
The problem is that I am dealing with legacy data that is, let us just say 'less than ideal', and some records have invalid ids so I need to put the not-found="ignore"
attribute on the many-to-many tag inside the bag. I do not see ANY way to accomplish this with FNH.
There is the .NotFound.Ignore()
on the References()
call, but not on the HasManyToMany
Call.
Can someone tell me what I am missing? Even if it is a hack to 'inject' the attribute after it is rendered / before configuring NH is fine, i just need it to work.
Thanks in advance.
UPDATE gcores answer will not work, it adds it to the wrong tag, see my comment on his answer for more info.