title: How to map composite id and many to one (multi column) with shared column
body: <p>I have a problem with shared column between composite id and multi column many to one relation in large legacy database. I have simplified the problem into mapping below which reproduce the problem:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"&gt;
      &lt;class name="Alfa"&gt;    
      &lt;composite-id name="AlfaId" class="AlfaCompositeId"&gt;
        &lt;key-many-to-one name="Bravo" class="Bravo" column="BRAVO_ID" /&gt;
        &lt;key-property name="CharlieId1" column="CHARLIE_ID1" /&gt;
      &lt;/composite-id&gt;
      &lt;many-to-one name="C" class="Charlie"&gt;
        &lt;column name="CHARLIE_ID1" /&gt;
        &lt;column name="BRAVO_ID" /&gt;
      &lt;/many-to-one&gt;
      &lt;property name="CookieA" column="COOKIE_A" /&gt;
      &lt;/class&gt;
    &lt;class name="Bravo"&gt;
      &lt;id name="BravoId" column="BRAVO_ID" /&gt;
      &lt;property name="CookieB" column="COOKIE_B" /&gt;
    &lt;/class&gt;
    &lt;class name="Charlie"&gt;
      &lt;composite-id&gt;
        &lt;key-property name="CharlieId1" column="CHARLIE_ID1" /&gt;
        &lt;key-many-to-one name="Bravo" class="Bravo" column="BRAVO_ID" /&gt; &lt;!-- Reused column !!! --&gt;
      &lt;/composite-id&gt;
      &lt;property name="CookieC" /&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Trying to save Alfa entity will throw:</p>
  
  <pre><code>IndexOutOfRangeException (Message=Invalid index 3 for this SqlParameterCollection with Count=3).
  </code></pre>
  
  <p>NHibernate is trying to add BRAVO_ID column value twice. Once for composite id and once for many to one FK.</p>
  
  <p><strong>Any way how to change to mapping XML to tell NHibernate to ignore second mapping of 'BRAVO_ID' column?</strong></p>
  
  <p>Any tips appreciated. </p>