Tips and Tricks in a world of Mix

Archive for the ‘HasMany’ Category

Fluent NHibernate HasMany PropertyRef solution

For a long time tried to find the solution for HasMany relationship not through ID property of the entity .
Starting from Fluent NHibernate build 164 there is a way , no patches included –
HasMany(x => x.Collection_TChild).AsBag()

Crazy thing , after including the FNH.dll of 164 version , we were compelled to add
column property to the Mapping . So , it means that we went through all our mappings
and added

Map(x => x.Property).Column(“PropertyNameAsItAppearsInOracleDataBase”);

otherwise the NHibernate didn’t recognized the mappings…


Tag Cloud

%d bloggers like this: