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
|