NHibernate 2.0 went gold yesterday and is available for download from here.
This is official release 2.0.0 GA. Please ensure you review this list of breaking changes from the release notes (also main items briefly listed below).
NOTE: Correction/clarification made 8/26 on Linq to NHibernate location.
The much anticipated Linq to NHibernate is available for now only via the NHibernate Contrib project and is not included in this NHibernate release.
Although likely to change, there does not appear to be an installer for Linq to NHibernate so it must be accessed from the source code. To gain access to this, you will need a subversion client such as Tortoise, and then download the code.
To download ‘Linq to NHibernate’ from the Trunk go here
The location of the bits can be found under the repository at this location:
http://nhcontrib.svn.sourceforge.net/viewvc/nhcontrib/trunk/src/NHibernate.Linq/
NOTE: Pictures Below Generated from NDepend, a must-have tool for .NET Development
gold release 2.0.0.GA
BREAKING CHANGES from NH1.2.1GA to NH2.0.0
-
Infrastructure
- .NET 1.1 is no longer supported
- Nullables.NHibernate is no longer supported (use nullable types of .NET 2.0)
- Contrib moved. New Location
-
Compile time
- NHibernate.Expression namespace was renamed to NHibernate.Criterion
- IInterceptor have additional methods. (IsUnsaved was renamed IsTransient)
- INamingStrategy
- IType
- IEntityPersister
- IVersionType
- IBatcher
- IUserCollectionType
- IEnhancedUserType
- IPropertyAccessor
- ValueTypeType renamed to PrimitiveType
-
Possible Breaking Changes for external frameworks
- Various classes were moved between namespaces
- Various classes have been renamed (to match Hibernate 3.2 names)
- ISession interface have additional methods
- ICacheProvider
- ICriterion
- CriteriaQueryTranslator
Initialization time
- <nhibernate> section, in App.config, is no longer supported and will be ignored. Configuration schema for configuration file and App.config is now identical, and the App.config section name is: <hibernate-configuration>
- <hibernate-configuration> have a different schema and all properties names are cheked
- configuration properties are no longer prefixed by “hibernate.”, if before you would specify “hibernate.dialect”, now you specify just “dialect”
- All named queries will be validated at initialization time, an exception will be thrown if any is not valid (can be disabled if needed)
- Stricter checks for proxying classes (all public methods must be virtual)
Run time
- SaveOrUpdateCopy() returns a new instance of the entity without changing the original
- AutoFlush will not occur outside a transaction - Database transactions are never optional, all communication with the database must occur inside a transaction, whatever you read or write data.
- NHibernate will return long for count(*) queries on SQL Server
- <formula> must contain parenthesis when needed
- These HQL function names may cause conflict in your HQL reserved names are:
- substring
- locate
- trim
- length
- bit_length
- coalesce
- nullif
- abs
- mod
- sqrt
- upper
- lower
- cast
- extract
- concat
- current_timestamp
- sysdate
- second
- minute
- hour
- day
- month
- year
- str
- <any> when meta-type=”class” the persistent type is a string containing the Class.FullName
- In order to set a parameter in a query you must use SetParameter(”paraName”, typeof(YourClass).FullName, NHibernateUtil.ClassMetaType)
Mapping
- <any> : default meta-type is “string” (was “class”)









[...] NHIbernate 2.0 Goes Beta 1 after Microsoft ‘Linq to Entities’ receives ‘vote of no confidence’ NOTE: NHibernate 2.0 GOLD is released. This post is outdated. Click here for the info. [...]
Pingback by NHIbernate 2.0 Goes Beta 1 after Microsoft ‘Linq to Entities’ receives ‘vote of no confidence’ « ubiquitous fluency — 08.24.08 @ 2:27 pm
Nice NDepend analysis to go with the news… You can see the use of Castle components for example. Too bad Linq will not be ready for a bit.
Comment by web — 08.24.08 @ 10:19 pm
[...] Thus came the idea of publishing a similar post for the new release of NHibernate 2.0. This post NHibernate 2.0 Gold Release analysis NHibernate 2.0 with NDepend and lists breaking functional changes, while I'll focus [...]
Pingback by NHibernate 2.0: Changes Overview - Patrick Smacchia [MVP C#] — 08.26.08 @ 12:01 pm
[...] Thus came the idea of publishing a similar post for the new release of NHibernate 2.0. This post NHibernate 2.0 Gold Release analysis NHibernate 2.0 with NDepend and lists breaking functional changes, while I'll focus [...]
Pingback by NHibernate 2.0: Changes Overview - taccato! trend tracker, cool hunting, new business ideas — 08.26.08 @ 12:14 pm
Now updated with location of Linq to NHibernate.
Comment by Damon Wilder Carr — 08.26.08 @ 12:43 pm
[...] 2.0 GA was released. Download here. Overview of changes available here. Permalink | [...]
Pingback by Firebird News » NHibernate 2.0 GA released — 08.26.08 @ 2:12 pm
The reason that NhLinq is not included in the release is that it is not feature complete and there are some major bugs preventing it to be stable.
A new implementation has been started in trunk and hopefully be released with 2.1 if a stability can be achieved.
Comment by Tuna Toksoz — 08.27.08 @ 4:17 pm
Current Trunk Linq to NHibernate Status:
(245 tests), Success
NHibernate.Linq.Tests (245 tests), Success
AggregateTests (10 tests), Success
AggregateWithStartsWith, Success
AggregateWithEndsWith, Success
AggregateWithContains, Success
AggregateWithEquals, Success
AggregateWithNotStartsWith, Success
AggregateWithMonthFunction, Ignored: TODO
AggregateWithBeforeYearFunction, Ignored: TODO
AggregateWithOnOrAfterYearFunction, Ignored: TODO
AggregateWithUpperAndLowerFunctions, Ignored: TODO
AggregateWithCustomFunction, Ignored: TODO
BinaryBooleanExpressionTests (8 tests), Success
TimesheetsWithEqualsTrue, Success
NegativeTimesheetsWithEqualsTrue, Success
TimesheetsWithEqualsFalse, Success
NegativeTimesheetsWithEqualsFalse, Success
TimesheetsWithNotEqualsTrue, Success
NegativeTimesheetsWithNotEqualsTrue, Success
TimesheetsWithNotEqualsFalse, Success
NegativeTimesheetsWithNotEqualsFalse, Success
DynamicQueryTests (1 test), Success
CanQueryWithDynamicOrderBy, Success
EnumTests (4 tests), Success
CanQueryOnEnumStoredAsInt32_High_1, Success
CanQueryOnEnumStoredAsInt32_Unspecified_2, Success
CanQueryOnEnumStoredAsString_Meduim_2, Success
CanQueryOnEnumStoredAsString_Small_1, Success
FunctionTests (7 tests), Ignored: Calling functions doesn’t work currently
SubstringFunction, Ignored
LeftFunction, Ignored
ReplaceFunction, Ignored
CharIndexFunction, Ignored
IndexOfFunctionExpression, Ignored
IndexOfFunctionProjection, Ignored
TwoFunctionExpression, Ignored
IExpandProviderTests (2 tests), Success
TestValidExpandProviderInterface, Success
TestExpand, Success
IUpdatableTests (12 tests), Success
TestValidUpdateInterface, Success
TestClearChanges, Success
TestGetResource, Success
TestCreateResource, Success
TestSetValue, Success
TestGetValue, Success
TestSaveChanges, Success
TestDeleteResource, Success
TestSetReference, Success
TestAddReferenceToCollection, Success
TestRemoveReferenceFromCollection, Success
TestResolveResource, Success
LinqQuerySamples (85 tests), Success
DLinq1, Success
DLinq2, Success
DLinq3, Success
DLinq3b, Success
DLinq4, Success
DLinq5, Success
DLinq6, Success
DLinq7, Success
DLinq8, Success
DLinq9, Success
DLinq10, Success
DLinq11, Success
DLinq12, Success
DLinq12b, Success
DLinq12c, Success
DLinq12d, Success
DLinq13, Success
DLinq14, Success
DLinq15, Success
DLinq16, Success
DLinq17, Ignored: TODO
DLinq17b, Ignored: TODO
DLinq17c, Ignored: TODO
DLinq18, Success
DLinq19, Success
DLinq20, Success
DLinq21, Success
DLinq22, Success
DLinq23, Success
DLinq24, Success
DLinq25, Ignored: TODO
DLinq26, Success
DLinq27, Success
DLinq28, Ignored: TODO
DLinq29, Success
DLinq30, Success
DLinq31, Ignored: TODO
DLinqJoin1, Success
DLinqJoin1a, Success
DLinqJoin1b, Success
DLinqJoin1c, Success
DLinqJoin1d, Success
DLinqJoin1e, Success
DLinqJoin2, Success
DLinqJoin3, Ignored: TODO
DLinqJoin4, Success
DLinqJoin5, Ignored: TODO
DLinqJoin6, Ignored: TODO
DLinqJoin7, Ignored: TODO
DLinqJoin8, Ignored: TODO
DLinqJoin9, Ignored: TODO
DLinqJoin10, Ignored: TODO
DLinq36, Success
DLinq37, Success
DLinq38, Success
DLinq39, Success
DLinq40, Success
DLinq41, Ignored: TODO
DLinq42, Ignored: TODO
DLinq43, Ignored: TODO
DLinq44, Success
DLinq45, Success
DLinq46, Success
DLinq47, Success
DLinq48, Success
DLinq48b, Success
DLinq49, Success
DLinq50, Ignored: TODO
DLinq51, Success
DLinq52, Success
DLinq52b, Success
DLinq53, Success
DLinq53b, Success
DLinq53c, Success
DLinq53d, Success
DLinq54, Ignored: TODO
DLinq55, Ignored: TODO
DLinq56, Ignored: TODO
DLinq57, Ignored: TODO
DLinq58, Ignored: TODO
DLinq59, Ignored: TODO
DLinq60, Success
DLinq61, Success
DLinq62, Success
DLinq63, Success
MethodCallTests (2 tests), Success
CanExecuteAny, Success
CanExecuteAnyWithArguments, Success
OrderByTests (7 tests), Success
AscendingOrderByClause, Success
DescendingOrderByClause, Success
AggregateAscendingOrderByClause, Ignored: NHibernate does not currently support subqueries in select clause (no way to specify a projection from a detached criter
AggregateDescendingOrderByClause, Ignored: NHibernate does not currently support subqueries in select clause (no way to specify a projection from a detached criter
ComplexAscendingOrderByClause, Success
ComplexDescendingOrderByClause, Success
ComplexAscendingDescendingOrderByClause, Success
PagingTests (5 tests), Success
Customers1to5, Success
Customers11to20, Success
CustomersChainedTake, Ignored: NHibernate does not currently support subqueries in from clause
CustomersChainedSkip, Ignored: NHibernate does not currently support subqueries in from clause
CountAfterTakeShouldReportTheCorrectNumber, Ignored: NHibernate does not currently support subqueries in from clause
ProjectionsTests (10 tests), Success
ProjectAnonymousTypeWithWhere, Success
ProjectConditionals, Success
ProjectAnonymousTypeWithMultiply, Success
ProjectAnonymousTypeWithSubstraction, Success
ProjectAnonymousTypeWithDivision, Success
ProjectAnonymousTypeWithAddition, Success
ProjectAnonymousTypeAndConcatenateFields, Success
ProjectKnownType, Success
ProjectAnonymousType, Success
ProjectUserNames, Success
PropertyMethodMappingTests (2 tests), Success
CanExecuteCountInSelectClause, Ignored: NHibernate does not currently support subqueries in select clause (no way to specify a projection from a detached criter
CanExecuteCountInWhereClause, Success
QueryReuseTests (13 tests), Success
CanReuseAfterFirst, Success
CanReuseAfterFirstOrDefault, Success
CanReuseAfterSingle, Success
CanReuseAfterSingleOrDefault, Success
CanReuseAfterAggregate, Ignored: TODO
CanReuseAfterAverage, Success
CanReuseAfterCount, Success
CanReuseAfterCountWithPredicate, Success
CanReuseAfterLongCount, Success
CanReuseAfterLongCountWithPredicate, Success
CanReuseAfterMax, Success
CanReuseAfterMin, Success
CanReuseAfterSum, Success
QueryUtilityTests (7 tests), Success
MethodsWorkLikeFluentInterfaces, Success
SetCacheableActsOnInnerCriteria, Success
SetCacheModeActsOnInnerCriteria, Success
SetCacheRegionOnInnerCriteria, Success
SetCommentActsOnInnerCriteria, Success
RegisterCustomActionActsOnInnerCriteria, Success
ActionIsInvokedForImmediateResult, Success
RegresstionTests (1 test), Success
HierarchicalQueries, Success
SelectionTests (12 tests), Success
CanGetCountOnQueryWithAnonymousType, Success
CanGetFirstWithAnonymousType, Success
CanAggregateWithAnonymousType, Success
CanSelectUsingMemberInitExpression, Success
CanSelectNestedAnonymousType, Success
CanSelectNestedMemberInitExpression, Success
CanSelectNestedMemberInitWithinNewExpression, Success
CanSelectSingleProperty, Success
CanSelectBinaryExpressions, Success
CanSelectWithMultipleBinaryExpressions, Success
CanSelectWithMultipleBinaryExpressionsWithOr, Success
CanSelectWithAnySubQuery, Success
WhereSubqueryTests (21 tests), Success
TimesheetsWithNoEntries, Success
TimeSheetsWithCountSubquery, Success
TimeSheetsWithCountSubqueryReversed, Success
TimeSheetsWithCountSubqueryComparedToProperty, Success
TimeSheetsWithCountSubqueryComparedToPropertyReversed, Success
TimeSheetsWithAverageSubquery, Success
TimeSheetsWithAverageSubqueryReversed, Success
TimeSheetsWithAverageSubqueryComparedToProperty, Ignored: Need to coalesce the subquery - timesheet with no entries should return average of 0, not null
TimeSheetsWithAverageSubqueryComparedToPropertyReversed, Ignored: Need to coalesce the subquery - timesheet with no entries should return average of 0, not null
TimeSheetsWithMaxSubquery, Success
TimeSheetsWithMaxSubqueryReversed, Success
TimeSheetsWithMaxSubqueryComparedToProperty, Success
TimeSheetsWithMaxSubqueryComparedToPropertyReversed, Success
TimeSheetsWithMinSubquery, Success
TimeSheetsWithMinSubqueryReversed, Success
TimeSheetsWithMinSubqueryComparedToProperty, Success
TimeSheetsWithMinSubqueryComparedToPropertyReversed, Success
TimeSheetsWithSumSubquery, Success
TimeSheetsWithSumSubqueryReversed, Success
TimeSheetsWithSumSubqueryComparedToProperty, Ignored: Need to coalesce the subquery - timesheet with no entries should return sum of 0, not null
TimeSheetsWithSumSubqueryComparedToPropertyReversed, Ignored: Need to coalesce the subquery - timesheet with no entries should return sum of 0, not null
WhereTests (36 tests), Success
NoWhereClause, Success
OrWithTrueReducesTo1Eq1Clause, Success
AndWithTrueReducesTo1Eq0Clause, Success
WhereWithConstantExpression, Success
FirstElementWithWhere, Success
FirstElementWithQueryThatReturnsNoResults, Success
FirstOrDefaultElementWithQueryThatReturnsNoResults, Success
SingleElementWithQueryThatReturnsNoResults, Success
SingleOrDefaultElementWithQueryThatReturnsNoResults, Success
UsersRegisteredAtOrAfterY2K, Success
UsersRegisteredAtOrAfterY2K_And_Before2001, Success
UsersByNameAndRegistrationDate, Success
UsersRegisteredAfterY2K, Success
UsersRegisteredAtOrBeforeY2K, Success
UsersRegisteredBeforeY2K, Success
UsersRegisteredAtOrBeforeY2KAndNamedNHibernate, Success
UsersRegisteredAtOrBeforeY2KOrNamedNHibernate, Success
TestDataContext, Success
UsersWithNullLoginDate, Success
UsersWithNonNullLoginDate, Success
UsersWithDynamicInvokedExpression, Success
UsersWithComponentProperties, Success
UsersWithNestedComponentProperties, Success
UsersWithAssociatedEntityProperties, Success
UsersWithEntityPropertiesThreeLevelsDeep, Success
UsersWithoutRole, Success
UsersWithRole, Success
UsersWithStringContains, Success
UsersWithArrayContains, Success
UsersWithListContains, Success
TimesheetsWithCollectionContains, Success
UsersWithStringNotContains, Success
UsersWithArrayNotContains, Success
UsersWithListNotContains, Success
TimesheetsWithCollectionNotContains, Success
TimesheetsWithEnumerableContains, Success
Comment by Damon Wilder Carr — 08.29.08 @ 9:11 am
[...] http://blog.domaindotnet.com/2008/08/24/nhibernate-20-gold-released-must-wait-for-linq-to-nhibernate... [...]
Pingback by Data Access discussed at Xcalia » Blog Archive » Alternative to the Entity Framework? — 09.02.08 @ 2:14 pm
[...] Nhibernate 2.0: Otro software listo, en este caso para persistencia de objetos en bases de datos. [...]
Pingback by Noticias 03-Septiembre - La Web de Programación — 09.03.08 @ 3:45 pm
[...] Thus came the idea of publishing a similar post for the new release of NHibernate 2.0. This post NHibernate 2.0 Gold Release analysis NHibernate 2.0 with NDepend and lists breaking functional changes, while I'll focus [...]
Pingback by NHibernate 2.0: Changes Overview - Mirrored Blogs — 09.04.08 @ 11:42 pm
NHibernate 2.0 release … that’s fine!! but where is the NHibernate 2.0 documentation/reference!? How to use the new stuff, if nobody knows how?!
Comment by Mike — 09.24.08 @ 4:19 am
[...] NHibernate 2.0 gold Released – Must Wait for ‘Linq to NHibernate’ « ubiquitous fluency [...]
Pingback by Visual Studio 2010 Gets Serious about Visual Metrics – Screen Shots Here Look Promising but still no NDepend…. « team domain.dot.net — 10.13.08 @ 9:09 pm