I want to import groups of mapping files into my .cfg.xml file, so that my apps don't have to manage the mappings from all of my data access jars. I originally envisaged something like this:
Code:
<hibernate-configuration>
<session-factory>
<property ... />
...
<mapping resource="..."/>
<mapping-bundle resource="..."/>
<mapping-bundle resource="..."/>
</session-factory>
</hibernate-configuration>
Where a mapping-bundle resource would point to a file containing something like this:
Code:
<hibernate-mapping-bundle>
<mapping resource="..."/>
<mapping resource="..."/>
<mapping resource="..."/>
</hibernate-mapping-bundle>
That is, it would be a cfg.xml file with no configuration properties, just mapping files.
In HHH-1485, Christian suggested that I "Use XML entities for includes. Refer to any XML documentation.". Can anyone expand on that? I thought I was reasonably familiar with XML, but I don't know of any standard way to include the contents of another XML file. If it really is a standard XML thing, then maybe someone can recommend an XML forum that I should check out?
Alternatively, does anyone know of any non-programmatic way of setting up a selection of mappings from a jar, in a way that doesn't require oodles of .cfg.xml editing when the jar changes?