多个字典映射到同一个表

时间:2017-08-08 12:16:26

标签: c# nhibernate fluent-nhibernate

我有一个这样的课程:

public class SwissPhoneNumberPartsRecordings : Entity
{
    public virtual IDictionary<string, Recording> AreaCode { get; set; }
    public virtual IDictionary<string, Recording> FirstPart { get; set; }
    public virtual IDictionary<string, Recording> SecondPart { get; set; }
    public virtual IDictionary<string, Recording> ThirdPart { get; set; }
}

我想将其映射到下表

SwissPhoneNumberPartsRecordings的列:

  • ID(PK)
  • AreaCodeID - &gt;表IndexedRecordings
  • 的FK到ID列
  • FirstPart - &gt;表IndexedRecordings
  • 的FK到ID列
  • SecondPart - &GT;表IndexedRecordings
  • 的FK到ID列
  • ThirdPart - &gt;表IndexedRecordings
  • 的FK到ID列

IndexedRecordings的列:

  • ID(PK)
  • RecordingID - &gt;表Recordings
  • 的FK到ID列
  • Index - &gt; Key
  • 中字典的SwissPhoneNumberPartsRecordings

如何使用Fluent NHibernate进行映射?我也愿意在必要时引入某种新的实体IndexedRecordings

0 个答案:

没有答案
相关问题