title: How to dynamically add Entity in Hibernate?
body: <p>I'm a java developer. I'm using <a href="https://spring.io" rel="nofollow">spring 4.0.1</a> and <a href="http://hibernate.org" rel="nofollow">hibernate 4.2.21</a>. I have a class as follow:</p>
  
  <pre><code>@Entity
  @Inheritance(...)
  public abstract class Feature{
     @Id
     @GeneratedValue
     protected Long id;
  
     ...
  
  }
  </code></pre>
  
  <p>Now I have some many class as follow:   </p>
  
  <p><strong>Label.java class:</strong></p>
  
  <pre><code>@Entity
  public class Label extends Feature{
     protected String str;
  
     ...
  }
  </code></pre>
  
  <p><strong>Point.java class:</strong></p>
  
  <pre><code>@Entity
  public class Point extends Feature{
     protected Integer intg;
  
     ...
  }
  </code></pre>
  
  <p>I have more than 20 Entity class that extends from <code>Feature</code> class. Is there any way to add dynamically this classes(such as <code>Label</code> and <code>Point</code>) to the project without writing hard code?   </p>
  
  <p><strong>update</strong>: </p>
  
  <p>For example, Hibernate get data from a database and then according this data, create models. </p>
  
  <ol>
  <li>Is it possible?</li>
  <li>How do I do?</li>
  </ol>