Well, I'm working on an application which syncs two databases. I need to setup hibernate.cfg.xml for 2 databases. Postgresql and Firebird. I'd like to create a generic class to set up my hibernate.cfg.xml.
I'd like to do something like this:
currentSessionFactory = new AnnotationConfiguration()
.setProperty("hibernate.dialect", entity.getDialect())
.setProperty("hibernate.connection.driver_class", entity.getDriverClass())
I need a new hibernate.cfg.xml for the second database but I can't set up it via xml, I need to do it through Java code.
How should I do it ?