A technique we can usu, is to map both: Reference
and the ReferenceId
. One of them just must be marked as insert="false"
update="false"
// readonly reference with all the stuff for querying
References(x => x.actiongroup)
.Column("appointment_actiongroup_id")
.Not.Insert().Not.Update();
// the only editable mapping
Map(x => x.actiongroupId, "appointment_actiongroup_id");
I use the inversed approach, the ReferenceId is readonly, becuase now it is hard to manage the correct ID during the INSERT... but this is working