title: Table per Concrete Class Hierarchy in Hibernate
body: <p>I have the following Hibernate Mapping, which has to be mapped using the Table per Concrete Class Hierarchy:</p>
  
  <pre><code>&lt;hibernate-mapping package='dao'&gt;
      &lt;meta attribute='class-description'&gt;&lt;/meta&gt;
      &lt;class name='PropertyDAO'&gt;
          &lt;id name='id' column='id_property'&gt;
              &lt;generator class='assigned'/&gt;
          &lt;/id&gt;
          &lt;property name='address' column='address' type='string'/&gt;
          &lt;union-subclass name='HouseDAO' table='house'&gt;
              &lt;property name='noOfRooms' column='noOfRooms'/&gt;
              &lt;property name='totalArea' column='totalArea'/&gt;
              &lt;property name='price' column='price'/&gt;
          &lt;/union-subclass&gt;
          &lt;union-subclass name='LandDAO' table='land'&gt;
              &lt;property name='area' column='area'/&gt;
              &lt;property name='unitPrice' column='unitPrice'/&gt;
          &lt;/union-subclass&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Which means in the database i have only 2 tables : </p>
  
  <ul>
  <li>house (id_property(PK), address, noOfRooms, totalArea, price)</li>
  <li>land (id_property(PK), address, area, unitPrice)</li>
  </ul>
  
  <p>As far as I understood, in this case the ids need to be generated explicitly before calling .save(), so my question is: How can I create a strategy for the automatically generation of the ids, so that the ids from the concrete class form a continuous domain when joined.</p>