title: Decouple Hibernate Mapping from EAR build with Wildcard Imports on Load
body: <p>Part 1: </p>
  
  <p>I have a model.hbm.xml file that is often update, which currently requires a full project build and deployment whenever it is modified.</p>
  
  <p>Can I break this out, so that the model.hbm.xml is read from the file-system, or a remote location (i.e. \file server\C$\Path\To\Hibernate\Mappings) when the application starts?</p>
  
  <p>Currently I'm loading it from persistence.xml with <code>&lt;mapping-file&gt;model.hbm.xml&lt;/mapping-file&gt;</code></p>
  
  <p>Part 2:</p>
  
  <p>What I really want is to load all *.hbm.xml files from a specified directory when the application starts.</p>
  
  <p>Is there any wildcard/directory support for loading hibernate mappings?</p>
  
  <hr>
  
  <p>Update:</p>
  
  <p>I've found a semi-solution to loading the mapping-file from a remote location</p>
  
  <pre><code>&lt;mapping-file&gt;file:////FileServerIP/path/to/hbm/model.hbm.xml&lt;/mapping-file&gt;
  </code></pre>
  
  <p>Allows me to store the mapping file outside of the build, in a place where all servers have access.</p>
  
  <p>I would like to implement this using a .properties file, so that the FileServerIP can be independent of the build as well. I haven't found out how to do that yet.</p>
  
  <p>My simple attempts at loading directories/wildcards have also been unfruitful.</p>
  
  <pre><code>&lt;mapping-file&gt;file:////FileServerIP/path/to/hbm/*.hbm.xml&lt;/mapping-file&gt;
  &lt;mapping-file&gt;file:////FileServerIP/path/to/hbm/&lt;/mapping-file&gt;
  </code></pre>
  
  <p>Both failed to load the model.hbm.xml file.</p>