Tips and Tricks in a world of Mix

Posts tagged ‘build 164’

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()
.KeyColumn(“CHILDPROPERTY_TOJOINBY”)
.PropertyRef(“Parent_Property”);

p.s.
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…

Advertisements

Tag Cloud

%d bloggers like this: