流利的NHibernate有很多,但没有找到

流利的NHibernate有很多,但没有找到,nhibernate,fluent-nhibernate,nhibernate-mapping,Nhibernate,Fluent Nhibernate,Nhibernate Mapping,我有以下FNH映射片段: HasManyToMany((c) => c.Plaintiffs) .LazyLoad() .WithTableName("invoicePlantiff") .WithChildKeyColumn("PersonReferenceID") .WithParentKeyColumn("invoiceID") .FetchType.Join(); 产生以下HBM: <bag name="Plaintiffs" acc

我有以下FNH映射片段:

HasManyToMany((c) => c.Plaintiffs)
    .LazyLoad()
    .WithTableName("invoicePlantiff")
    .WithChildKeyColumn("PersonReferenceID")
    .WithParentKeyColumn("invoiceID")
    .FetchType.Join();
产生以下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>

问题是我处理的是遗留数据,也就是说,让我们说“不太理想”,一些记录的ID无效,因此我需要在包中的多对多标签上添加
not found=“ignore”
属性。我看不到用FNH实现这一目标的任何方法

References()
调用上有
.NotFound.Ignore()
,但在
HasManyToMany
调用上没有

有人能告诉我我错过了什么吗?即使在渲染属性之后/配置NH之前“注入”属性是一种黑客行为,我也需要它来工作

提前谢谢


更新gcores答案将不起作用,它会将其添加到错误的标签中,有关详细信息,请参阅我对其答案的评论。

我对此不确定,但是否有SetAttribute

HasManyToMany((c) => c.Plaintiffs)
.LazyLoad()
.WithTableName("invoicePlantiff")
.WithChildKeyColumn("PersonReferenceID")
.WithParentKeyColumn("invoiceID")
.FetchType.Join()
.SetAttributte("not-found", "ignore");
更新:

很抱歉,我知道有一个SetAttribute,但我不确定它是否符合您的要求


另一个选择是混合使用Fluent NH和XML映射,Fluent NH wiki或可以看到这一点。

我刚刚提交了一个更改,将
NotFound
添加到
HasMany
hasmanytomy
调用中。希望有帮助

实际上,gcores不起作用,因为它将属性添加到
包中,这是无效的。它需要在包内进行
多对多