ICSC ERP System is developed by many engineers at the same time. Every application may be updated frequently after deploying. This results the mapping model (*.hbm.xml) may be added or modified at the runtime. Therefore dynamic updating the hibernate.cfg.xml is required to solve the frequently change of those models.
So my solution is :After DA deploys the system, DA will publish an event, with the information of the materials deployed. DE subscribes this event and then check whether the deployed materials included *.hbm.xml. After that comparing the current hibernate.cfg.xml with those found hbm.xml and add additional hbm.xml to thehibernate.cfg.xml.
Features :
1. The event is published by DA per every AP. So the checking job of DE
is executed per every AP.
2. The subscriber of DE modifies the hibernate.cfg.xml after checking the deployed materials.
3. Every AP uses Hibernate easily without registering the Model Mapping Data.