Hi there,
I am using for some legacy db the corresponding domainclasses with mappings. Now the Ids of the entities are calculated by some stored Procedure in the DB which gives back the Id for the new row.(Its legacy, I cant change this) Now I create the new entity , set the Id and Call Save. But nothing happens. no exeption. Even NH Profiler does not say a bit. its as the Save call does nothing. I expect that NH thinks that the record is already in the db because its got an Id already. But I am using Id(x => x.id).GeneratedBy.Assigned() and intetionally the Session.Save(object) method.
I am confused. I saw so many samples there it worked.
does any body have any ideas about it?
public class Appendix
{
public virtual int id { get; set; }
public virtual AppendixHierarchy AppendixHierachy { get; set; }
public virtual byte[] appendix { get; set; }
}
public class AppendixMap : ClassMap<Appendix>
{
public AppendixMap ()
{
WithTable("appendix");
Id(x => x.id).GeneratedBy.Assigned();
References(x => x.AppendixHierachy).ColumnName("appendixHierarchyId");
Map(x => x.appendix);
}
}