天天看點

一起談.NET技術,NHibernate 3.0.0.Alpha1 釋出及新特性介紹  釋出  下載下傳位址  特性介紹  博文分享

  剛剛NHibernate的Leader——Fabio Maulo釋出了NHibernate 3.0.0.Alpha1版本,這是NHibernate 3.0.0的第一個公開測試版本。

NHibernate源碼:NHibernate-3.0.0.Alpha1-src.zip

NHibernate二進制檔案:NHibernate-3.0.0.Alpha1-bin.zip

  NHibernate 3.0.0版本可以說是跨時代的一個版本,NHibernate貢獻者們經過了一年的完善和測試,增加了非常多的新特性和修複很多BUG。下面我自己歸類總結一下這些新特性吧。

  新增兩種方式流配置(fluent-configuration)和lambda表達式配置(lambda-configuration)配置SessionFactory。

  新增對WCF的支援,提供WcfOperationSessionContext,我們可以直接配置"current_session_context_class"為"wcf_operation",直接在WCF中應用NHibernate。

  在Configuration類中新增了AddDeserializedMapping(HbmMapping mappingDocument, string documentFileName)方法,可以直接解析HbmMapping,我們可以選擇不使用xml檔案Mapping。

  在NHibernate 3.0.0版本中,新增了New Embebed Linq Provider和New strongly typed query API (QueryOver)兩種查詢方式,那麼NHibernate 3.0.0現在支援了7種查詢方式。

  QueryOver是Lambda表達式方式的條件(Criteria)查詢,可讀性強且支援property-renaming特性。

  Linq是由Steve Strong貢獻者開發的,完全基于AST的Linq Provider實作。在之前的NHibernate2.1.2版本中沒有提供Linq功能,Ayende Rahien貢獻者另外設計第三方NHiberante.Linq.dll(目前已經停止了維護),它是基于Criteria API的Linq Provider,主要功能是将簡單的Linq表達式轉化為Criteria API,是以存在很多天生的不足,現在我們可以完全抛棄這個第三方dll了,完全使用NHibernate3.0.0自帶全新的Linq查詢支援。

  除了上面可以歸類的新特性,還提供了很多新特性,我先來列舉一下:

  屬性延遲加載特性:這是我們一直以來夢寐以求的功能,NHibernate 3.0.0實作了,這裡注意一下,它僅支援Castle的bytecode-providers,不支援Spring.Net和LinFu。

  No Proxy關聯特性:這個功能和上面的差不多。

  内置hbm2ddl工具。

其實,我之前介紹了有關NHibernate 3.0.0版本的新特性,其中NH剖析系列就是基于NHibernate 3.0.0版本的,下面列舉一下分享下,以後會慢慢博文Query部分和其他部分特性介紹。

<a href="http://www.cnblogs.com/lyj/archive/2010/01/18/inside-nh3-fluent-configuration.html" target="_blank">NH剖析:Configuration篇——SessionFactory的Properties之fluent-configuration配置</a>

<a href="http://www.cnblogs.com/lyj/archive/2010/01/20/inside-nh3-lambda-configuration.html" target="_blank">NH剖析:Configuration篇——SessionFactory的Properties之lambda-configuration配置</a>

<a href="http://www.cnblogs.com/lyj/archive/2010/01/22/inside-nh3-cache-lambda-configuration.html" target="_blank">NH剖析:Configuration篇——SessionFactory的Cache之lambda-configuration配置</a>

<a href="http://www.cnblogs.com/lyj/archive/2010/04/21/inside-nh3-conform-introduction.html" target="_blank">NH剖析:Mapping篇之ConfORM實戰(1):概覽</a>

<a href="http://www.cnblogs.com/lyj/archive/2010/04/22/inside-nh3-mapping-introduction.html" target="_blank">NH剖析:Mapping篇之Mapping概覽</a>

<a href="http://www.cnblogs.com/lyj/archive/2010/05/08/inside-nh3-mapping-set.html" target="_blank">NH剖析:Mapping篇之集合映射基礎(1):Set映射</a>

<a href="http://www.cnblogs.com/lyj/archive/2010/05/10/inside-nh3-mapping-bag.html" target="_blank">NH剖析:Mapping篇之集合映射基礎(2):Bag映射</a>

<a href="http://www.cnblogs.com/lyj/archive/2010/05/12/inside-nh3-mapping-list.html" target="_blank">NH剖析:Mapping篇之集合映射基礎(3):List映射</a>

<a href="http://www.cnblogs.com/lyj/archive/2010/05/12/inside-nh3-mapping-map.html" target="_blank">NH剖析:Mapping篇之集合映射基礎(4):Map映射</a>

希望本文對你有所幫助。

繼續閱讀