Fluent NHibernate 可以支持 NHibernate 的所有映射吗
我想将 Fluent NHibernate 与 NHibernate 一起使用。但我想知道 Fluent NHibernate 是否支持 NHbernate 的所有映射。还是坚持使用 NHibernate 更好?
I want to use Fluent NHibernate with NHibernate. But I want to find out whether Fluent NHibernate support all mappings from NHbernate. Or is it better to stick with NHibernate?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Fluent NHibernate 支持自动映射、标准 nhibernate xml 映射 (hbm),当然还有Fluent 样式映射。您可以将任何这些映射与 Fluent NHibernate 混合搭配。
Fluent 不支持 NHibernate 3.2 版本中引入的新的通过代码映射样式(它们确实是不同的动物),但我不确定这是否真的是一个问题。就我个人而言,我建议此时使用 Fluent,因为有更多的文档,并且用户群比通过代码映射更大。
Fluent NHibernate 相当易于使用,并且相对于 xml 样式 (hbm) 映射绝对具有优势。您可以在 Fluent Wiki 上了解更多信息
Fluent NHibernate supports automappings, standard nhibernate xml mappings (hbm) and of course Fluent style mappings. You can mix and match any of those mappings with Fluent NHibernate.
Fluent does not support the new mapping by code style introduced in version 3.2 (they're really different animals) of NHibernate but I'm not sure that this is really an issue. Personally I would recommend using Fluent at this point because there is far more documentation and the user base is larger than mapping by code.
Fluent NHibernate is fairly easy to use and definitely has it's advantages over xml style (hbm) mappings. You can read about this more on the Fluent Wiki
仅供参考;我尝试使用标准 hbm.xml 来映射“多对任意”,这目前不受流畅的 nhibernate 支持;
尝试了 Configuration.AddXmlFile 和 HbmMappings
仍然失败,并显示错误消息,指出无效属性“多对任意”
just FYI; I tried using standard hbm.xml for mapping "many-to-any" which is currently not supported by fluent nhibernate;
tried both Configuration.AddXmlFile and HbmMappings
both still failed with error message saying invalid properties "many to any"