title: Mapping a relationship from an entity to two other entities with Fluent NHibernate
body: <p>I have two different classes mapped with Fluent NHibernate</p>
  
  <pre><code>public class File1Map: ClassMap&lt;File1&gt; {
      CompositeId()
         .KeyProperty(x =&gt; x.IdFile)
         .KeyProperty(x =&gt; x.IdRow);
  
      HasMany(x =&gt; x.Errors).AsBag().KeyColumns.Add("IdFile", "IdRow");
  }
  
  public class File2Map: ClassMap&lt;File2&gt; {
      CompositeId()
         .KeyProperty(x =&gt; x.IdFile)
         .KeyProperty(x =&gt; x.IdRow);
  
      HasMany(x =&gt; x.Errors).AsBag().KeyColumns.Add("IdFile", "IdRow");
  }
  
  public class File1 {
      public int IdFile {get; set;}
      public int IdRow {get; set;}
      public List&lt;Error&gt; Errors {get; set;}
      // ...other properties different from File2
  }
  
  public class File2 {
      public int IdFile {get; set;}
      public int IdRow {get; set;}
      public List&lt;Error&gt; Errors {get; set;}
      // ...other properties different from File1
  }
  </code></pre>
  
  <p>And a class with errors, containing description for each class.</p>
  
  <pre><code>public class ErrorMap: ClassMap&lt;Error&gt; {
      Map(p =&gt; p.IdFile);
      Map(p =&gt; p.IdRow);
      Map(p =&gt; p.Description);
  }
  
  public class Error {
      public int IdFile {get; set;}
      public int IdRow {get; set;}
      public string Description {get; set;}
  }
  </code></pre>
  
  <p>How can i map <code>Error</code> to <code>File1</code> and <code>File2</code>?
  Can I use has many for defining which column to use for the relation? (<code>Error</code> side.)</p>