FluentNHibernate或端口NHibernate映射的代码 [英] FluentNHibernate or port to NHibernate mapping by code

本文介绍了FluentNHibernate或端口NHibernate映射的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个项目使用NH和FNH来生成映射(一些流利的一些自动映射)。我还需要一些bug和缺少的功能,但是似乎FNH会因为集成到NHibernate中的代码映射而死。

问题:贡献于FNH或将映射迁移到代码映射或confORM,并修复问题/执行功能?

解决方案

在我们的办公室,已经使用NHibernate 3年了。我们一直在考虑转向Nhibernate,但从来没有采取行动。使用hbm.xml文件仍然是最容易调试/更改。这些XML文件的两个常见问题是,他们都在创建sessionfactory期间验证,他们不是重构安全。

由于一个错误,我不得不更新NHibernate的新版本(我们使用NHib 2.1.2GA),当我实现3.2GA时,我们也被赋予了使用loquacious映射(通过代码映射)的能力。我决定使用流利的流利,因为我没有依赖到另一个项目(流利),事实上,NHibernate将不会出货,如果由代码的映射被打破。

请注意,Loquacious映射也不完整。当我用代码映射所有东西的时候,我发现了像property-ref这样的基本东西并不总是被实现。因此,即使它已经发货,但并不是100%完成。虽然这不会令人震惊,但它有缺陷。是。真。 ;)



获取(报告)错误的更多信息,查看NHibernate错误数据库: https://nhibernate.jira.com/browse/NH



希望这有帮助。
问候,特德

I have several projects using NH and FNH to generate the mappings (some Fluent some Automapped). There are still some bugs and missing features i need, but it seems that FNH could die because of mapping-by-code integrated into NHibernate.

Question: Contribute to FNH or to migrate the mappings to mapping-by-code or confORM and fixing problems/implementing features there?

解决方案

At our office, we have been using NHibernate for 3 years now. We've been thinking about making a move to Fluent Nhibernate but never made the move. Using hbm.xml files was still the easiest to debug/alter. Two common problems of those xml files are that they are all validated during the creating of the sessionfactory and they are not refactor-safe.

Due to a bug I had to update a newer release of NHibernate (we were using NHib 2.1.2GA) and when I implemented 3.2GA we also were handed the ability to use loquacious mappings (mapping by code). I decided to use Loquacious over Fluent because I don't have a dependency to another project (Fluent) and the fact that NHibernate won't be shipped if mapping by code is broken.

Be aware though, that Loquacious mapping isn't complete either. While I was mapping everything by code, I found out basic stuff like property-ref wasn't always implemented. Thus even though it's shipped, it's not 100% complete. And while this will not come as a shocker, it has bugs. yes. really. ;-)

for more info on (reported) bugs, check out the NHibernate bug database: https://nhibernate.jira.com/browse/NH

Hope this helps. Regards, Ted

这篇关于FluentNHibernate或端口NHibernate映射的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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