title: Hibernate - derived java classes for tables
body: <p>I generated mapping files and POJOs in Netbeans instead of writing them myself. Is it possible to use a derived class in a place of an inherited class? An example would be something like this:</p>
  
  <pre><code>Person.hbm.xml - mapping file
  
  Person.java - generated class (strategy class per table)
  
  PersonExtended - class that extends Person.java
  </code></pre>
  
  <p>So when I create a new object:</p>
  
  <pre><code>PersonExtended personextended = new PersonExtended(&lt;parameters&gt;);
  </code></pre>
  
  <p>Would I be able to call methods like:</p>
  
  <p><code>session.save(personextended) or session.delete(personextended)</code></p>
  
  <p>?</p>
  
  <p>Is this scenario sensible or should I add any code that I need to in a generated class? Thanks in advance for help or suggestions. </p>
  
  <p>-------Edit--------</p>
  
  <p>In my database I don't have the typical structure that would be possible to be mapped as an inheritance. I merely want to keep the additional methods separate from the main java class for an entity.</p>
  
  <p>Best Regards,
  sass.</p>