组件继承 [英] Component Inheritance

查看:78
本文介绍了组件继承的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以给我/指向我有关Nhibernate 3.10中组件继承支持的官方参考"吗? 已经在Google上搜索了,但从未找到任何相关参考.

Can anyone give/point me to 'official references' about component inheritance support in Nhibernate 3.10 ? Already google it, but never find any reference about that.

谢谢

推荐答案

NHibernate(和Hibernate一样)不支持组件继承.您有两个相对不愉快的选择:

NHibernate (and Hibernate for that matter) does not support component inheritance out of the box. You have two relatively unpleasant options:

  1. 将层次结构映射为实体.
  2. 使用IUserType编写自定义的水合/脱水代码. 本文 (java,但应该适用于C#).
  1. Map hierarchy as entities.
  2. Write custom hydration/dehydration code using IUserType. This workaround is described in this article (java, but should work for C#).

同时,您可以投票此功能将在Hibernate中实现,也许有一天会移植到NHibernate中. NHibernate 版本此功能请求.

In the mean time you can vote for this feature to be implemented in Hibernate and maybe some day ported to NHibernate. NHibernate version of this feature request.

这篇关于组件继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆