FNH映射中的新SetAttribute()
是什麼?我需要設置子我鑑別值,因爲字符串是不優選 - old post如何使用FNH爲子類設置歧視列類型?
與NH 2.1.2.4000,FNH 1.1.0.689
public class BaseBuildingMap : ClassMap<BaseBuilding>
{
public BaseBuildingMap()
{
Id(x => x.Id);
DiscriminateSubClassesOnColumn<int>("BuildingType", -1);
}
}
public class PowerStationMap : SubclassMap<PowerStation>
{
public PowerStationMap()
{
Map(x => x.ElectricityProduction);
}
}
NHibernate.MappingException:無法格式鑑別價值的SQL字符串實體Model.Test.PowerStation ---> System.FormatException:輸入字符串格式不正確。
我需要設置SetAttribute("discriminator-value", "-1");
但是沒有這樣的方法。
編輯1個
問題:如何設置區分列類型與FNH子類?
謝謝,但這沒有幫助...我改變了我的問題 – 2010-09-01 15:01:56