title: how to handle composite key hibernate
body: <p>My hbm.xml file is like this:   </p>
  
  <pre><code>&lt;hibernate-mapping&gt;
  &lt;class name="pojopackage.WordhelperWordusage" table="WORDHELPER_WORDUSAGE" schema="SOZANA"&gt;
      &lt;composite-id name="id" class="pojopackage.WordhelperWordusageId"&gt;
          &lt;key-property name="idwh" type="java.lang.Integer"&gt;
              &lt;column name="IDWH" /&gt;
          &lt;/key-property&gt;
          &lt;key-property name="idwu" type="java.lang.Integer"&gt;
              &lt;column name="IDWU" /&gt;
          &lt;/key-property&gt;
          &lt;key-property name="type" type="java.lang.Integer"&gt;
              &lt;column name="TYPE" /&gt;
          &lt;/key-property&gt;
      &lt;/composite-id&gt;
      &lt;many-to-one name="wordhelper" class="pojopackage.Wordhelper" update="false" insert="false" fetch="select"&gt;
          &lt;column name="IDWH" /&gt;
      &lt;/many-to-one&gt;
      &lt;many-to-one name="wordusage" class="pojopackage.Wordusage" update="false" insert="false" fetch="select"&gt;
          &lt;column name="IDWU" /&gt;
      &lt;/many-to-one&gt;
  &lt;/class&gt;
  </code></pre>
  
  <p></p>
  
  <p>But I have two POJO classes which are "WordhelperWordusage.java" and "WordhelperWordusageId.java", so i am confused, how should i handle this classes? How to implement? Thanks in advance!
  <strong>Update</strong></p>
  
  <p>I did like this </p>
  
  <pre><code>wordhelper_wordusage.save(wordhelper);
  wordhelper_wordusage.save(wordusage);
  session.save(wordhelper);
  session.save(wordusage);
  session.save(wordhelper_wordusage);
  </code></pre>
  
  <p>But its giving me exception like this:</p>
  
  <pre><code>Hibernate: select max(ID) from SOZANA.WORDFORM
  Hibernate: select max(ID) from SOZANA.WORDHELPER
  Exception in thread "main" org.hibernate.id.IdentifierGenerationException:
  ids for this   class must be manually assigned before calling save():   pojopackage.WordhelperWordusage
  </code></pre>
  
  <p></p>