Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Fluent nhibernate 在Fluent NHibernate自动映射中更改联接类映射的列_Fluent Nhibernate_Mapping_Nhibernate Mapping_Automapping_Joined Subclass - Fatal编程技术网

Fluent nhibernate 在Fluent NHibernate自动映射中更改联接类映射的列

Fluent nhibernate 在Fluent NHibernate自动映射中更改联接类映射的列,fluent-nhibernate,mapping,nhibernate-mapping,automapping,joined-subclass,Fluent Nhibernate,Mapping,Nhibernate Mapping,Automapping,Joined Subclass,我有一笔遗产 public abstract class UserEntity : Entity { public virtual int Id { get; protected set; } } public class Employee : UserEntity { public virtual string Email { get; set; } } Entity是NH类的标准,其中重写的方法等于、GetHashCode等,我使用AutMap重写 我用流利的NHiber

我有一笔遗产

public abstract class UserEntity : Entity
{
    public virtual int Id { get; protected set; }
}

public class Employee : UserEntity
{
    public virtual string Email { get; set; }
}
Entity是NH类的标准,其中重写的方法等于、GetHashCode等,我使用AutMap重写

我用流利的NHibernate自动绘图

<class xmlns="urn:nhibernate-mapping-2.2" name="Dto.Entities.UserEntity" table="UserEntities">
    <id name="Id" type="System.Int32">
      <column name="Id" />
      <generator class="identity" />
    </id>
    <joined-subclass name="Dto.Entities.Employee" table="Employees">
      <key foreign-key="FK_Employee_UserEntity">
        <column name="UserEntityId" />
      </key>
      <property name="Email" type="System.String">
        <column name="Email" />
      </property>
    </joined-subclass>
</class>

我想将联接子类中键列的名称从UserEntityId更改为EmployeeId

我试着

public类UserEntityOverride:IAutoMappingOverride
{
公共无效替代(自动映射)
{
mapping.JoinedSubClass(“EmployeeId”);
}
}
但是没有成功

我现在使用NuGet软件包中最新的FNH:FluentNHibernate 1.2.0.712。 此外,我还有更多的配置和约定,它们可能会以某种方式影响此配置,但我已经在一个明确的解决方案上尝试过,但结果是相同的

public class UserEntityOverride : IAutoMappingOverride<UserEntity>
{
    public void Override(AutoMapping<UserEntity> mapping)
    {
        mapping.JoinedSubClass<Employee>("EmployeeId");
    }
}