title: Mapping many-to-many relation for class inheritance  in Hibernate/NHibernate
body: <p>In the most simplified version , here is my problem
  <img src="https://i.stack.imgur.com/42vt2.png" alt="enter image description here"></p>
  
  <pre><code>public class D{
   public List&lt;A&gt; ListofA {get;set;}
  }
  
  public interface A{
  }
  
  public class B implements A{
  }
  
  public class C implements A{
  }
  </code></pre>
  
  <p><code>class B</code> maps to <em>Table B</em><br/>
  <code>class C</code> maps to <em>Table C</em><br/></p>
  
  <p><strong>A is just an interface and is not mapped to any table.</strong></p>
  
  <p><strong>How do I define the polymorphic (<code>many-to-many</code>) association between D -> A</strong></p>
  
  <p>I am using <code>NHibernate</code> with <code>FluentMapping</code>.</p>