adim wrote:
Sure I'm interested, I use dynamic models so if I could load hbm files after startup it will be great.
Where do you load the mapping to? Is it to memory or you just add it as a resource in your class loader?
Well, I take a different approach: it's the user who submits a new mapping (I call this "object model") to the core via a Web interface. I then validate this model using Hibernate's Configuration object, and if the validation is OK, I replace the current SessionFactory.
I don't use the Configuration's .addResource(), or .addFile() method (although it could be possible). I use .addXML(), which takes an XML string corresponding to the mapping (and which I serialize to the database).