rafonso wrote:
-->In Hibernate, when we create mapping files (*.HBM.XML), normally they must bo localized in directorie where are their respectives classes (like bin/package1/package2/). How can I change this? Or how do I say that mapping files are in a other directory (like conf/hibernate/)?
As long as conf/hibernate is in your CP, you can do
Code:
configuration.addFile("/not/my/package/notMyClassName.hbm.xml);
In 2.1 you can also do
Code:
configuration.addDirectory(File dir);
rafonso wrote:
Well, after read my mapping file I want change "table" attribute from "class" to substitute "XXX" substring for another String. It will be a dynamic mapping. Does someone have any idea?
Load the files by yourself putting it in a DOM, do your expansion and give it to Hibernate
Code:
configuration.addDocument(myExpandedDOM);