just started on a project to convert a NHibernate Fluent mapping into the NHibernate Mapping By Code as part of an upgrade associated with one of my old applications.
Almost there, but I stumbled upon something I can't convert properly and found myself stumped. Now I hope maybe some of you experienced out there can help me with it. Below is the original mapping using Fluent:
HasMany<ExampleEntity>(x => x.OtherExampleEntities)
.OptimisticLock.False()
.AsSet()
.KeyColumn("ParentExampleEntityId")
.Inverse()
.Cascade.SaveUpdate();
Now I got stuck on converting the KeyColumn-part of my mapping, below is my current progress (thus keyColumn still being there):
Set(x => x.OtherExampleEntities, x => {
x.OptimisticLock(false);
x.KeyColumn("ParentExampleEntityId");
x.Inverse(true);
x.Cascade(Cascade.Persist);
}, map => map.OneToMany(r => r.Class(typeof(ExampleEntity))));
There's not a lot of documentation regarding the mapping by code part of NHibernate but I've been spending a lot of time with the posts made by notherdev (@blogspot.se). All help is appreciated.