-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Supporting Multiple Configuration Objects
PostPosted: Thu Jan 17, 2008 1:50 am 
Newbie

Joined: Thu Jan 17, 2008 1:38 am
Posts: 1
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 17, 2008 11:33 am 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
Yes, that is possible, I have done it.
You can have your mappings reused by different configurations, which in turn can connect to different databases or even different schemas within the same database.

_________________
Gonzalo Díaz


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.