如何将本词典与最新的fluentNHibernate版本进行映射?

如何将本词典与最新的fluentNHibernate版本进行映射?,nhibernate,fluent-nhibernate,mapping,Nhibernate,Fluent Nhibernate,Mapping,我还有一个问题。我升级到FluentNHibernate,现在有了一个 我的dictionary映射有问题 我试图映射的类具有以下属性 IDictionary Lohn参数 映射如下所示 HasMany(x => x.LohnParameter) .ForeignKey("cat_condition_version__id") .DictionaryKey("wrd_cntry__id") .OneToMany<boLohnartEigenscha

我还有一个问题。我升级到FluentNHibernate,现在有了一个 我的dictionary映射有问题

我试图映射的类具有以下属性

IDictionary Lohn参数

映射如下所示

HasMany(x => x.LohnParameter) 
     .ForeignKey("cat_condition_version__id") 
     .DictionaryKey("wrd_cntry__id") 
     .OneToMany<boLohnartEigenschaften>() 
     .Not.Lazy() 
     .Inverse() 
     .Cascade.AllDeleteOrphan();
HasMany(x=>x.LohnParameter)
.ForeignKey(“类别条件版本id”)
.DictionaryKey(“wrd\u cntry\u id”)
.OneToMany()
.不懒
.Inverse()
.Cascade.AllDeleteOrphan();
生成的hbm.xml如下所示:

<map cascade="all-delete-orphan" inverse="true" lazy="false" name="LohnParameter" table="boLohnartVersionLohnParameter" mutable="true">
        <key>
          <column name="cat_condition_version__id" />
        </key>
        <index-many-to-many class="proSoft.Office.Model.Business.Welt.boLand, proSoft.Office.Model.Business, Version=0.1.19.20243, Culture=neutral, PublicKeyToken=b0e4f89242e69335">
          <column name="wrd_cntry__id" />
        </index-many-to-many>
        <one-to-many class="proSoft.Office.Model.Business.Konditionen.boLohnartEigenschaften, proSoft.Office.Model.Business, Version=0.1.19.20243, Culture=neutral, PublicKeyToken=b0e4f89242e69335" />
      </map>

对于新版本,编译器抱怨,属性 “外键”不见了。我现在什么都试过了,但都做不到 工作正常。我最后一次尝试是:

  HasMany(x => x.LohnParameter) 
     .AsMap<boCountry>( 
       index => index.Column("wrd_cntry__id").Type<boCountry>(), 
       element => element.Type<boLohnartEigenschaften>() 
     ) 
     .KeyColumn("cat_condition_version__id") 
     .Not.LazyLoad() 
     .Inverse() 
     .Cascade.AllDeleteOrphan();
HasMany(x=>x.LohnParameter)
.AsMap(
index=>index.Column(“wrd\u cntry\uu id”).Type(),
element=>element.Type()
) 
.KeyColumn(“类别条件版本id”)
.Not.LazyLoad()
.Inverse()
.Cascade.AllDeleteOrphan();
但我经常犯的错误是:

{”无法确定以下项的类型: proSoft.Office.Model.Business.Welt.boCountry、, proSoft.Office.Model.Business,版本=0.1.14.556,区域性=中性, PublicKeyToken=b0e4f89242e69335,对于列: NHibernate.Mapping.Column(wrd\u cntry\u id)“}

我不知道该做什么

问候


Christian Erhardt

我想你在寻找这个

HasMany(x => x.LohnParameter) 
    .AsEntityMap("wrd_cntry__id")

谢谢你的提示,这是正确的方法。正确的映射如下所示:

     HasMany(x => x.LohnParameter)
        .KeyColumn("cat_condition_version__id")
        .AsEntityMap("wrd_cntry__id")         
        .Not.LazyLoad()
        .Inverse()
        .Cascade.AllDeleteOrphan();
这将产生完全相同的hbm.xml文件


谢谢大家!

谢谢,这是我需要的提示!