【发布时间】:2012-12-21 11:29:03
【问题描述】:
例如,我有一个实体。具有以下属性:
public class Entity
{
public int CustomerId { get; set; }
public Customer { get; set; }
}
如何将 CustomerId 映射两次。一次用于 int 属性,一次用于多对一关系?
<many-to-one name="Customer" column="[CustomerId]" class="Customer"/>
<property name="CustomerId" column="[CustomerId]" type="Int64" />
仅此而已,行不通。我已经尝试过,将它们设为只读但没有成功。
【问题讨论】:
标签: nhibernate nhibernate-mapping