title: Hibernate - How to map a new class to two existing Tables
body: <p>I have two entities: Vehicle and Weapon classes. They are mapped respectively to Vehicle.hbm.xml and Weapon.hbm.xml. Both have their respective DAOs. All are working fine. </p>
  
  <p>Here's my idea. I want to create a class VehicleWeapon that has all the properties of the Vehicle and Weapon entities. I want to declare a Hibernate mapping file: VehicleWeapon.hbm.xml. I want the properties in the mapping file to match the properties of the Weapon and Vehicle entities.</p>
  
  <p>So that when I add, delete, or save a VehicleWeapon entity, the corresponding changes will reflect on the backing Vehicle and Weapon tables. (I could probably do an HQL query, but I want to know first if the idea I'm asking is doable).</p>
  
  <p>Is this possible? If yes, can you show me an example? (Of course, the Vehicle and Weapon classes are hypothetical classes. I do have an actual scenario where I need this idea to be implemented).</p>
  
  <p>Or what better options are there? Can you provide a direct link or concrete example? Thanks a lot.</p>