What to be aware of when upgrading NHibernate from 1.2 to 3.2?

╄→гoц情女王★ 提交于 2019-12-04 16:43:32

This really depends on what nhibernate functions you are using. Take the release nodes and see if anything is in there you are using. Most functions are still working the same in 3.2. You have to do some upgrades in your mapping files.

I would do one change at the time. So get it working without Fluent, and decide if it is worth doing going to fluent. You should also have a look a QueryOver and the usage of linq.

One of the most interesting new features in NH 3.2 is that you can now map with code, instead of with HBL files. This is the same feature that FNH has had for years, but integrated into the main NH project.

I have not used this myself in NH (I'm a big fan of FNH Automapping), but my reading indicates that many FNH users consider this much less mature than the FNH equivalent.

One area where FNH is still miles ahead of NH is the aforementioned Automapping. NH just does not do that yet (though there are some misleading blog posts which imply that it does).

Probably not of much value for your current project (you've already gone through the pain of setting up your HBL files), but could be very valuable for new projects. We use it in our project, and it allows us to almost change our object model at will, and let Automapping rebuild the database for us.

Lastly, as I write this there is no official release for FNH with NH 3.2. I've been experimenting with the latest FNH builds (1.3), and it's "not quite there yet". But it probably will be soon.

Nhibernate 3.2 has a mostly functional Linq provider, which is nice if you like Linq.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!