title: hibernate composite key
body: <p>Is it necessary that composite-id should be mapped to class ??</p>
  
  <p>can it be like this ?</p>
  
  <pre><code>&lt;composite-id&gt;
    &lt;key-property=..../&gt;
    &lt;key-property=..../&gt;
  &lt;/composite-id&gt;
  </code></pre>
  
  <p>or should be </p>
  
  <pre><code>&lt;composite-id class=....&gt;
    &lt;key-property=..../&gt;
    &lt;key-property=..../&gt;
  &lt;/composite-id&gt;
  </code></pre>
  
  <p>should that necessary that if we have composite key then that class should implement <code>equals()</code> and <code>override()</code> method ?</p>