I am working with a larger application that will be deployed as multiple ears and jars which can either operate independently or in unisom. There is one shared framework.jar which all modules use as a foundation.
Currently, each module has its own hibernate.cfg.xml file and its own set of hibernate mappings. The foundation framework.jar also has its own config and mappings file. The fremework.jar is included in each module.
The problem I am running into is that hibernate will load the first hibernate.cfg.xml file it comes across, load the mapping files defined there and stop at that.
What I would like is for hibernate to load the appropriate hibernate.cfg.xml file for the module which calls it. Now, can this be done dynamically somehow or do I have to explicitly pass hibernate.cfg.xml into the configure method of SessionFactory?
|