[ Apologies if this is a standard question! It seems to me that it should be, but if so I haven't been typing in the right search terms to find information on it! ]
I'm writing an object model for scientific data, which I want several applications to be able to use. For example, there is a web application which will use Hibernate and the object model to perform searches on the database and then present the data. There is also another web application which has no interest in data formatting, but wants to use the values for comparison against simulations. Finally, there is a command-line based tools for importing data into the system, which will also be using Hibernate and the object model.
I want to allow all these applications (and maybe more) to use my Hibernate mappings, without each having to "own" a local copy of the mapping files. At the moment I have one JAR for the object model (with no database specific code in it) and a separate JAR for the Hibernate mappings and some db utility methods --- can the client applications (web or otherwise) use the mapping files in the JAR to define how they use Hibernate? For example, if each application has a hibernate.cfg.xml file, is there a special path that needs to be used to tell them to read the mapping files from a JAR dependency rather than from the local run path?
Thanks!
Andy
|