title: Hibernate annotation mapping for java extended classes
body: <p>I am working on a Spring Hibernate project where I have three classes 
  <code>BaseEntity</code>, <code>Person</code> &amp; <code>Owner</code>.</p>
  
  <p><code>Person</code> extends <code>BaseEntity</code>, <code>Owner</code> extends <code>Person</code>.</p>
  
  <h2>BaseEntity.java</h2>
  
  <pre><code>public class BaseEntity {
  
      private Integer id;
  
          Getters &amp; Setters 
  </code></pre>
  
  <h2>Person.java</h2>
  
  <pre><code>public class Person extends BaseEntity {
  
      private String firstName;
  
      private String lastName;
  
         Getters &amp; Setters 
  </code></pre>
  
  <h2>Owner.java</h2>
  
  <pre><code>@Entity
  @Table(name="OWNERS")
  public class Owner extends Person {
  
      @Column(name="ADDRESS")
      private String address;
  
      @Column(name="CITY")
      private String city;
  
      @Column(name="TELEPHONE")
      private String telephone;
  
      Getter and Setters
  </code></pre>
  
  <p>Now I want to map all the properties of the three classes in a single table which
  is <code>Owner</code>. Can anyone please help me how do I map?</p>
  
  <p>I have a xml based mapping for this &amp; I want to do it in annotation</p>
  
  <pre><code>&lt;class name="org.springframework.samples.petclinic.Owner" table="owners"&gt;
          &lt;id name="id" column="id"&gt;
              &lt;generator class="identity"/&gt;
          &lt;/id&gt;
          &lt;property name="firstName" column="first_name"/&gt;
          &lt;property name="lastName" column="last_name"/&gt;
          &lt;property name="address" column="address"/&gt;
          &lt;property name="city" column="city"/&gt;
          &lt;property name="telephone" column="telephone"/&gt;
      &lt;/class&gt;
  </code></pre>
  
  <p>I thought of using table per class inheritance mapping but here in xml I see no 
  discriminator column being used.</p>