title: Spring Boot Load orm.xml
body: <p>I want to externalize my custom mappings for Jpa to an XML file. I've seen examples of using orm.xml however when I create orm.xml in resources/META-INF it does not appear to be loaded. All the examples I've seen it gets loaded through persistence.xml, which I don't have with Spring Boot. I didn't turn up much searching for answers. How do I make Spring Boot load my orm.xml file?</p>
  
  <p>Example orm.xml</p>
  
  <pre><code>&lt;entity-mappings version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence/orm"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence/orm
      http://xmlns.jcp.org/xml/ns/persistence/orm_2_1.xsd"&gt;
  &lt;sql-result-set-mapping name="AuthorMappingXml"&gt;
      &lt;entity-result entity-class="org.thoughts.on.java.jpa.model.Author"&gt;
          &lt;field-result name="id" column="authorId"/&gt;
          &lt;field-result name="firstName" column="firstName"/&gt;
          &lt;field-result name="lastName" column="lastName"/&gt;
          &lt;field-result name="version" column="version"/&gt;
      &lt;/entity-result&gt;
  &lt;/sql-result-set-mapping&gt;
  &lt;sql-result-set-mapping name="AuthorBookCountMappingXml"&gt;
      &lt;entity-result entity-class="org.thoughts.on.java.jpa.model.Author"&gt;
          &lt;field-result name="id" column="id"/&gt;
          &lt;field-result name="firstName" column="firstName"/&gt;
          &lt;field-result name="lastName" column="lastName"/&gt;
          &lt;field-result name="version" column="version"/&gt;
      &lt;/entity-result&gt;
      &lt;column-result name="bookCount" class="java.lang.Long" /&gt;
  &lt;/sql-result-set-mapping&gt;
  &lt;sql-result-set-mapping name="BookAuthorMappingXml"&gt;
      &lt;entity-result entity-class="org.thoughts.on.java.jpa.model.Author"&gt;
          &lt;field-result name="id" column="authorId"/&gt;
          &lt;field-result name="firstName" column="firstName"/&gt;
          &lt;field-result name="lastName" column="lastName"/&gt;
          &lt;field-result name="version" column="authorVersion"/&gt;
      &lt;/entity-result&gt;
      &lt;entity-result entity-class="org.thoughts.on.java.jpa.model.Book"&gt;
          &lt;field-result name="id" column="id"/&gt;
          &lt;field-result name="title" column="title"/&gt;
          &lt;field-result name="author" column="author_id"/&gt;
          &lt;field-result name="version" column="version"/&gt;
      &lt;/entity-result&gt;
  &lt;/sql-result-set-mapping&gt;
  &lt;sql-result-set-mapping name="BookValueMappingXml"&gt;
      &lt;constructor-result target-class="org.thoughts.on.java.jpa.value.BookValue"&gt;
          &lt;column name="id" class="java.lang.Long"/&gt;
          &lt;column name="title"/&gt;
          &lt;column name="version" class="java.lang.Long"/&gt;
          &lt;column name="authorName"/&gt;
      &lt;/constructor-result&gt;
  &lt;/sql-result-set-mapping&gt;
  &lt;/entity-mappings&gt;
  </code></pre>