5

I have one project using NHibernate 1.2. I know it's old, but I've used it since I'm working off NHibernate in Action, which targets that same version.

I've been thinking I should update my understanding of the tool, as well as the tool itself. But I wonder what the differences are between versions. I know 2.1 has been current for some time, and that 3.0 is in the works.

What benefits or features are gained, lost, or changed when moving to NHibernate 2.1 or 3.0?

Spoike
  • 119,724
  • 44
  • 140
  • 158
Grant Palin
  • 4,546
  • 3
  • 36
  • 55

6 Answers6

13

Off the top of my head and mixing 2.X and 3.0 features... LINQ support, EventListeners (more powerful Interceptors), System.Transaction support, generics support, multiquery, future queries, SchemaUpdate (rather than just SchemaExport), much better HQL parser, ... Plus numerous bug fixes. A lot has been going on in the NHibernate world since NH 1.2...

James Kovacs
  • 11,549
  • 40
  • 44
  • I agree. First-class LINQ support in NH3 (via the ISession.Query() extension method) is much improved over Ayende's proof-of-concept for NH2.X. The new ISession.QueryOver() strongly-typed Criteria support is also nice. – James Kovacs Nov 11 '10 at 04:43
7

With the 3.0.0 release, NHibernate includes support for LINQ, along with additional features such as:

Along with a long list of bug fixes and improvements, it has several new features including

  • A new strongly typed criteria API called QueryOver
  • Lazy loading of columns
  • Alias delimiting in generated SQL
  • Support for DetachedCriteria within IStatelessSession.
  • Improved support for LINQ, overcoming the HQL limitations of the previous provider.

Breaking change:

  • Upgrading users should be aware that one of the fixes means that null values in dictionaries are no longer silently ignored, which has the potential to break existing application code.
rebelliard
  • 9,592
  • 6
  • 47
  • 80
3

James Kovacs summarized it pretty well, but for a complete list of changes check https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/trunk/nhibernate/releasenotes.txt

It contains every single bug/improvement/new feature for all NH releases.

Diego Mijelshon
  • 52,548
  • 16
  • 116
  • 154
1

You get Linq support!

Keith Nicholas
  • 43,549
  • 15
  • 93
  • 156
0

I started on 2.x+ so I can't say much...but I'll for sure upgrade to 3.0 once it's out of beta. Mainly because QueryOver looks like ICriteria on type safe steriods!

dotjoe
  • 26,242
  • 5
  • 63
  • 77
0

v3: Removal of the dependency on log4Net (which is often a love-it or hate-it thing)

UpTheCreek
  • 31,444
  • 34
  • 152
  • 221