1.2 - NHibernate Templates

Topic updated 29-10-2007

 

ERS#4243/SessionFactory bug with ISession + ITransaction

The SessionFactory was not correctly handling the session / transaction and concurrent website activity could cause weird errors in the running application. The problem was that transaction was not handled using HttpContext. This is a very important fix , therefore we are releasing v1.2 because of this issue.

 

ERS# 4209 : Many-To-Many might fail on 1st generation

The helper class might raise an exception when executed for the 1st time. This happens because of "interdependencies" between different items and the fact that the related item have been not initialized yet.

 

ERS# 4211 : Self-Related Table == bug in Identity (xml)

It was detected as a foreign (not correct)

 

ERS#4220 Table Relation not correctly created for Self-Reference.

There was a case, that when the relation was manually created by the user (and thus, not imported by using Import Schema) the TableRelation helper class could be inverted, causing error when generating the NHibernate XML (because the link would be inverted).

 

ERS#4212 : POCO constructor (with properties ) should call the constructor w/o parameters

If not, most of cascading operations fail, because of the unsaved value not correctly set.

 

ERS#4215 : Constructor (for all props ) was not correctly adding nullable types for nullable properties (in the parameters).

 

ERS# 4216 : Many-To-Many : Add + Remove methods not ok.

The code inside the AddChild and RemoveChild methods for a many-to-many relation was not correct.

 

ERS#2594 : More user CodeBlocks for property Setter

clip0009

 

ERS#4247 : MsSQL Unique identifiers in PK --> compilation error in poco

Guids don't have a min value.

 

               public  Club()

               {

                       _clubID = System.Guid.MinValue;

               }

ERS#4248 : uniqueidentifier : if PK should use special guid generator

We are currently mapping all autonumber (pk) colums as a native and in case the gwtype is a GUID it should be useing GUID generator instead of native.

Native == IDENTITY

Guid == guid identifier.

 

<class name="Club" table="[dbo].[Clubs]"                                         >

               <id name="ClubID" access="nosetter.camelcase-underscore" column="`ClubID`" type="System.Guid"  >

                       <generator class="native" /  (should be using guid)

 

ERS#4249 : Simplified Access Property Bug

When accessing the simplified property for a nullable FK it could raise :

“Nullable object must have a value”

The bug was inside the synchronization code.