Upgrading NHibernate 1.0.2 to 2.1.2

We have a large application that is based on NHibernate 1.0.2. Recently we have noticed that if we want to utilize LINQ to NHibernate and some other new features of NHibernate, we must upgrade to latest version of NHibernate (2.1.2). I found a good starting point, started the migration process and here is problems I encountered:

1. Upgrade to new NHibernate dll.
2. Erased classes: ClassQueryCondition, HQLQuery, DataGraphQuery. These 3 classes are corporate level classes not NHibernate’s. They were using some features of NH 1.0.2 that was not present in newer versions.
3. Using “NHibernate.Criterion” instead of “NHibernate.Expression” namespace. For example in case of “NHibernate.Expression.Expression.Eq”. This change caused about 440 replacements.
4. Erasing or commenting anything using “DataGraphQuery” (corporate level class).
5. Replacements like “NHibernate.Expression.Eq” => “NHibernate.Criterion.Expression.Eq”. This caused about 400 replacements.
6. Related configurations in app.config’s and web.config’s changed to this:









NHibernate.Dialect.MsSql2005Dialect
NHibernate.Connection.DriverConnectionProvider
NHibernate.Driver.SqlClientDriver
Server=****;Database=****;Integrated Security=False;User ID=***; password=***;
NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle
false



7. In all .hbm files replaced “” to ““. default-lazy=”false” is added because we are not using lazy loading feature of NHibernate.

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *