title: subclass or Inheritance which way is best using hibernate hbm?
body: <p>Can someone share me the better approach for this below question using hibernate hbm files?</p>
  
  <p>Let's say I have 2 classes called Vehicle, Car and 2 tables Vehicles and Car. Vehicles having generic fields which suppose to have for every Car, Bus, etc.</p>
  
  <p>I am trying to create DomainObject for Car:</p>
  
  <ol>
  <li><p>Car extends Vehicle ? If so, can someone share me how to declare Vehicle class within Car hbm files and both the data get saved when Car object get saved ?</p></li>
  <li><p>I can have 2 hbm separate files (car, vehicle) and in Car class I can declare class (private Vehicle vehicle) and construct this object as a part of Car class and save the Car class using cascade. </p></li>
  </ol>
  
  <p>Can someone suggest which approach will be good ? I need to store the data in both the tables.</p>