title: Mapping many-to-one with composite-id
body: <p>I am trying to map a composite key with a many to one relationship.</p>
  
  <p>How to map a class A which own a composite id of 4 elements and a class B which own a composite id of 3 elements to realize a joint between these class both with the constraint:</p>
  
  <p>A(*) &lt;--> (1)B ?</p>
  
  <pre><code>&lt;hibernate-mapping&gt;
      &lt;class name="A" table="A_TABLE" lazy="true"&gt;
          &lt;composite-id&gt;
              &lt;key-property name="prop1" column="PROP1" type="string" /&gt;
              &lt;key-property name="prop2" column="PROP2" type="long" /&gt;
              &lt;key-property name="prop3" column="PROP3" type="long" /&gt;
              &lt;key-property name="prop4" column="PROP4" type="integer" /&gt;
          &lt;/composite-id&gt;
          &lt;property name="prop10" type="string" column="PROP10" /&gt;
          ...
      &lt;/class&gt;
  
      &lt;class name="B" table="B_TABLE" lazy="false"&gt;
          &lt;composite-id&gt;
              &lt;key-property name="prop1" column="PROP1" type="string" /&gt;
              &lt;key-property name="prop2" column="PROP2" type="long" /&gt;
              &lt;key-property name="prop3" column="PROP3" type="long" /&gt;
           &lt;/composite-id&gt;
           &lt;property name="prop20" type="string" column="PROP20" /&gt;
           ...
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>