Can the lastest version of Hibernate support multiple Configuration objects running concurrently using the same domain objects?
e.g. We have a java class Contact. We need to map it to different databases, dependant on some business rules.
For example, configuration 1 points to Database 1, and includes mappingContact1.xml which maps the Contact class to a table called BusinessContact, including fields name and workPhone.
Configuration 2 points to Database 2, and includes mappingContact2.xml which maps the Contact class to a table called Friends including fields name and emailAddress.
The business rules will be used choose the configuration, and this will automatically change the database (repository) and table that the contact is loaded from.
|