开发者

Mapping inheritance with fluent nhibernate seems a bit off

A part of my Model looks like this:

public class Person
{
    public virtual Guid Id { get; set; }
    public s开发者_Python百科tring Name { get; set; }
}

public class Employee : Person
{
    public virtual int EmployeeNumber { get; set; }
    public virtual Person Partner { get; set; }
}

The generated sql for this is:

create table [Person] (
   Id UNIQUEIDENTIFIER not null,
   Name NVARCHAR(255) null,
   Employee_id UNIQUEIDENTIFIER null,
   primary key (Id)
)

create table Employee (
   Person_id UNIQUEIDENTIFIER not null,
   EmployeeNumber INT null,
   Partner_Id UNIQUEIDENTIFIER null,
   primary key (Person_id)
)

Why is there a Employee_id UNIQUEIDENTIFIER null, inside the Person table?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜