<p>We have a project consisting of multiple subprojects. With each subproject we potentially have some hibernate mapping files but in the end only <strong>one actual hibernate session</strong>. Those subprojects could be combined in several ways, some depend on each other. My problem is that actually I want to have a SessionFactoryBean which would be able to collect those mappings/mappinglocations from the applicationContext(s) and configure itself.</p>

<p>Has somebody written something like this, or do I have to do it myself (I envision something a bit like the urlresolver or viewresolver functionality from SpringMVC)?</p>

```
LocalSessionFactoryBean
```
has a configLocations property.  You inject the list of config locations, and it will gather tham together for a single session factory configuration.