Making a NaturalId mutable
I have a mapping with a NaturalId composed by a reference and an integer propery. I need both to be mutable. I can't see a way to mark the NaturalId mutable in FNH.
With the following mapping, I can update OtherEntity, but I get an exception "immutable natural identifier of an instance of Namespace.Entity was altered" when I try to modify IntegerPropery.
public class EntityMap: ClassMap
{
public EntityMap()
{
Id(x => x.Id);
NaturalId()
.Reference(x => x.OtherEntity, "OtherEntityId").Not.ReadOnly()
.Property(x => x.IntegerProperty).Not.ReadOnly();
// more fields
}
}
What is the right mapping to accomplish this? I believe, in xml would be adding an attribute "mutable=true" to the natural-id tag...
Thanks