如何使用约定来指定外键,主键应该是连接的子类表上的相同列?

时间:2013-02-25 22:42:29

标签: c# fluent-nhibernate automapper fluent-nhibernate-mapping

标题几乎说明了一切。如果我有两个班级:

public class Account
{
    public virtual Guid AccountId { get; set; }
    public virtual string Name { get; set; }
}

public class VendorAccount : Account
{
    public virtual string TaxId { get; set; }
}

我如何使用约定来创建VendorAccount表(或者一些近似值):

create table VendorAccount
(
    AccountId uuid not null primary key references Account (AccountId),
    TaxId varchar
);

我一直在忙着这几天。 IJoinedSubclassConventionISubclassConvention不允许您指定ID,所有其他约定似乎也无法达到这种情况。

我得到的最接近的将是account_id列,这不是我想要的。

0 个答案:

没有答案
相关问题