I\'m trying to set up a relationship as follows. Each Master item has one or more Detail items:
public class Detail {
p
NH3 and above allow to correct save entities in case of uni-directional one-to-many mapping without annoying save null-save-update cycle, if you set both not-null="true" on inverse="false" on
FluentNHibernate code snippet for that:
public class MasterMap : ClassMap
{
public MasterMap()
{
Id(x => x.MasterId);
Map(x => x.Name);
HasMany(x => x.Details)
.Not.Inverse() //these options are very
.Not.KeyNullable() //important and work only if set together
.Not.KeyUpdate() //to prevent double update
.Cascade.All();
}
}