title: How to load all xml mapping files from hibernate.cfg.xml in hibernate?
body: <p>Suppose Here I specified one particular test.hbm.xml file. Instead I want to load all hbm.xml files available in my package.I have lots of hbm.xml mapping files. Inastead of specifying each of them, I want to load all of them. How to do it? Is it possible to do load them by hibernate.cfg.xml file?</p>
  
  <pre><code>hibernate-configuration&gt;
      &lt;session-factory&gt;
          &lt;property name="hibernate.bytecode.use_reflection_optimizer"&gt;false&lt;/property&gt;
          &lt;property name="hibernate.connection.driver_class"&gt;org.h2.Driver&lt;/property&gt;
          &lt;property name="hibernate.connection.password"&gt;&lt;/property&gt;
          &lt;property name="hibernate.connection.url"&gt;jdbc:h2:mem:dbUnitTest;DB_CLOSE_DELAY=-1;INIT=CREATE SCHEMA IF NOT EXISTS SFMFG\;SET SCHEMA SFMFG&lt;/property&gt;
          &lt;property name="hibernate.connection.username"&gt;sa&lt;/property&gt;
          &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.H2Dialect&lt;/property&gt;
          &lt;property name="cache.provider_class"&gt;org.hibernate.cache.EhCacheProvider&lt;/property&gt;  
          &lt;property name="hibernate.cache.use_second_level_cache"&gt;true&lt;/property&gt;  
  
          &lt;mapping resource="test.hbm.xml"/&gt;
      &lt;/session-factory&gt; 
  &lt;/hibernate-configuration&gt;
  </code></pre>