Hibernate version:
3.x
Hello.
We have here several subproject, all subproject result in a .jar containing various classes and some .hbm.xml mapping files
Then we have other projects (let's call them main projects), which use those .jar. In those other projects, we need to load hibernate configuration, this include all *.hbm.xml files present in those jar.
Assuming all those .jar are in classpath (WEB-INF/lib), we could use lots of
Code:
<mapping ressource="bla/bla.hbm.xml"/>
in our hibernate.cfg.xml. But it's not very easy to manage. If there are changes in a subproject (eg, one additionnal class 'X'), we need to add a corresponding mapping tag to all main projects.
It would be interresting if there was some way to have hibernate do things like 'Ok, need to use class X, let's explore the classpath ressources to find it's mapping', but all i see is either list mappings in main config file, either do some addClass() in main projects.
Is there some way to have hibernate related changes in subprojects automatically reflected to main projects (just update the .jar and it's done)?