1
我有兩個類,我試圖在Loquacious Nhibernate中映射。Loquacious Nhibernate和collabID外鍵
的映射是類似下面的
public class FooMap : ClassMapping<Foo>
{
Table("FooTableName");
ComposedId(compIDMapper =>
{
compIDMapper.Property(x => x.SomeInt, m => m.Column("SomeInt"));
compIDMapper.ManyToOne(x => x.SomeReference, m => m.Column("SomeReference"));
});
}
public class BarMap : ClassMapping<Bar>
{
Table("BarTableName");
Id(x => x.ID, m => m.Column("barID"));
ManyToOne(x => x.Foo, m => m.Columns(columnMapper =>
{
columnMapper.Name("SomeIntID"); //Both of these columns are in the BarTableName like they should be
columnMapper.Name("SomeReferenceID");
}));
}
但正在興建中的映射,當我得到以下錯誤:
Foreign key (FK554EAF2427B2CA28:BarTableName[SomeIntID])) must have same number of columns as the refe,renced primary key (FooTableName[SomeInt, SomeReference])
我不知道我在做什麼錯了,看起來應該可以工作,但是我現在一直在嘲弄我的頭,並且沒有到任何地方。關於我在做什麼的任何想法都是錯誤的?