如何将这个字典映射到最新的 FluentNHibernate 版本?
我还有一个问题。我升级到 FluentNHibernate 现在得到了 我的字典映射有问题。
我尝试映射的类具有以下属性
IDictionary LohnParameter
映射如下
HasMany(x => x.LohnParameter)
.ForeignKey("cat_condition_version__id")
.DictionaryKey("wrd_cntry__id")
.OneToMany<boLohnartEigenschaften>()
.Not.Lazy()
.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();
但我总是得到的错误是:
{“无法确定以下类型: proSoft.Office.Model.Business.Welt.boCountry, proSoft.Office.Model.Business,版本=0.1.14.556,文化=中性, PublicKeyToken=b0e4f89242e69335,对于列: NHibernate.Mapping.Column(wrd_cntry__id)"}
我不知道该做什么。
问候
Christian Erhardt
i've got one more question. I upgraded to FluentNHibernate and got now a
problem with my dicitionary mappings.
The class i'am trying to map has the following Property
IDictionary LohnParameter
The mapping is as follows
HasMany(x => x.LohnParameter)
.ForeignKey("cat_condition_version__id")
.DictionaryKey("wrd_cntry__id")
.OneToMany<boLohnartEigenschaften>()
.Not.Lazy()
.Inverse()
.Cascade.AllDeleteOrphan();
The resulting hbm.xml looks like this:
<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>
With the new version, the compiler complains, that the Property
"ForeignKey" is missing. I tried now everything, but i can't get it to
work properly. My last try was:
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();
But the error i always get is:
{"Could not determine type for:
proSoft.Office.Model.Business.Welt.boCountry,
proSoft.Office.Model.Business, Version=0.1.14.556, Culture=neutral,
PublicKeyToken=b0e4f89242e69335, for columns:
NHibernate.Mapping.Column(wrd_cntry__id)"}
I don't have clue what do do.
Regards
Christian Erhardt
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
发布评论
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我想你正在寻找这个
i think you searching for this