简体   繁体   English

从NHibernate 2.1迁移到Nhibernate 3.3

[英]Migration from NHibernate 2.1 to Nhibernate 3.3

I 'm in process of migrating from NHibernate 2.1 to Nhibernate 3.3. 我正在从NHibernate 2.1迁移到Nhibernate 3.3。 Please can anybody tell me briefly the steps to do so. 请任何人简要地告诉我这样做的步骤。 Following are the DLL's I'm using in my current Project 以下是我在当前项目中使用的DLL

  1. NHibernate.ByteCode.Castle 2.1 NHibernate.ByteCode.Castle 2.1
  2. NHibernate 2.1 NHibernate 2.1
  3. log4net 1.2 log4net 1.2
  4. Iesi.Collections 1.0 Iesi.Collections 1.0
  5. FluentNHibernate 1.0 FluentNHibernate 1.0
  6. Castle.DynamicProxy2 2.1 Castle.DynamicProxy2 2.1
  7. Castle.Core 1.1 城堡核心1.1
  8. Autofac 2.2 Autofac 2.2
  9. Antlr3.Runtime 3.1 Antlr3.Runtime 3.1

Also is there any need to change the code in the Fluent Hibernate Configuration? 还需要在Fluent Hibernate Configuration中更改代码吗? Following is the code. 以下是代码。

 if (_config == null)
 {
     _config = Fluently.Configure()
         .Database(MsSqlConfiguration.MsSql2008
             .ConnectionString(cs => cs.Is(ConnectionString))
             .AdoNetBatchSize(2000)
             .Raw("command_timeout", "600")

             .ProxyFactoryFactory("NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle")
             .ShowSql()
         )
   .
   .
   .
  }

Please let me know which DLL(s) to remove/upgrade and the changes in the Fluent NHibernate Code if any. 请让我知道要删除/升级的DLL,以及Fluent NHibernate代码中的更改(如果有)。

  • NH 3.3 has merged most of these dll's so NHibernate.dll (and .xml) is all you need NH 3.3已合并了大多数这些dll,因此您只需要NHibernate.dll(和.xml)
  • FLuentNHibernate only ships with 1 dll which has to be upgraded (there should be a 1.3 which is compatible with >= NH 3.2, may need a assembly redirect for NH 3.3) FLuentNHibernate仅随附必须升级的1个dll(应该有一个1.3版本,该版本与> = NH 3.2兼容,可能需要NH 3.3的程序集重定向)
  • in FluentNHibernate config .ProxyFactoryFactory() should be removed 在FluentNHibernate配置中.ProxyFactoryFactory()应该被删除
  • Castle.DynamicProxy2 and Autofac have nothing to do with NHibernate Castle.DynamicProxy2和Autofac与NHibernate无关

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM