title: Hibernate Mapping Package
body: <p>I'm using Hibernate Annotations.</p>
  
  <p>In all my model classes I annotate like this:</p>
  
  <pre><code>@Entity
  @Table
  public class SomeModelClass {
  //
  }
  </code></pre>
  
  <p>My hibernate.cfg.xml is</p>
  
  <pre><code>&lt;hibernate-configuration&gt;
     &lt;session-factory&gt;
        &lt;!-- some properties --&gt;
  
        &lt;mapping package="com.fooPackage" /&gt;
        &lt;mapping class="com.fooPackage.SomeModelClass" /&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>For every class I add to the com.fooPackage I have to add a line in the hibernate.cfg.xml like this:</p>
  
  <pre><code>&lt;mapping class="com.fooPackage.AnotherModelClass" /&gt;
  </code></pre>
  
  <p>Is there a way I can add new model classes but don't need to add this line to hibernate.cfg.xml?</p>