Looking at the documentation for Hibernate 3 and even 4 as well, it seems that one has to create the mapping classes before hand.
All those classes defined in hibernate.cfg.xml
or hibernate.properties
files are loaded as soon as the configuration is loaded and then any changes to these files will be ignored by hibernate.
Is there any way to add mapping classes at runtime dynamically?
Looked through the Spring booking process again. It loads those beans from the configuration file at the time of initialization. That's it. It never look back that file again