如何使用 Fluent nhibernate 创建表/类映射?
我正在尝试使用流畅的 nhibernate 创建类似于以下内容的映射:
<class name="IAccountManager"
abstract="true"
table="IAccountManager">
<id name="Id">
<generator class="hilo"/>
</id>
<union-subclass
table="DefaultAccountManager"
name="DefaultAccountManager">
<property name="FirstName"/>
</union-subclass>
... more subclasses
</class>
关于如何做到这一点的想法?
I'm trying to create a mapping similar to the following with fluent nhibernate:
<class name="IAccountManager"
abstract="true"
table="IAccountManager">
<id name="Id">
<generator class="hilo"/>
</id>
<union-subclass
table="DefaultAccountManager"
name="DefaultAccountManager">
<property name="FirstName"/>
</union-subclass>
... more subclasses
</class>
Thoughts on how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Fluent NHibernate 目前不支持 Union 子类。 FNH 允许您混合流利和 hbm 映射,因此您应该保留这种情况下的 hbm 映射。
Union-subclasses currently aren't supported by Fluent NHibernate. FNH allows you to mix fluent and hbm mappings, so you should keep the hbm mappings for this case.