-->
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: Two databases, two sets of mappings, one set of classes
PostPosted: Tue Oct 25, 2005 4:39 pm 
Newbie

Joined: Wed Oct 12, 2005 5:59 pm
Posts: 3
I have 2 databases for an application, one being a live database the other more of a warehouse or history of changes database. When a particular object is modified, it is updated is the live database and inserted into the warehouse database. The warehouse database is almost identical to the live database, however, it doesn't have any relationships and the PK's/identities are obviously different.

The only way I can think of to handle this is to have two configurations, one for the live db, one for the warehouse. This also means that I need two mapping files for each class that is persisted.

Does this seem like the best way to handle this?

If so then any ideas how to manage the mapping files? Is there anyway to alter the naming convention that Configuration.AddAssembly() looks for? The idea being that I could have two mapping files for my User class named:

User.hbm.xml
User.whbm.xml

I could call AddAssembly() for the live DB configuration to load the first file. Then alter the naming strategy and call AddAssembly() for the warehouse DB configuration having it find the second file named *.whbm.xml


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 27, 2005 9:29 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
Do you really need two set of mapping files? (what's the difference between them)

I don't know anyway to easily change the extension .hbm.xml (and I am not sure that it would be a wise choice); what you can do is create another assembly that will contain the second set...

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


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.