tags:

views:

411

answers:

1

Hi,

I'm working on an application that has a data publication mecanism that I designed & implemented. It allows one master instance of the app to feed data to many subscriber instances. This is implemented by loading the master's data into a set of temporary import tables that have the same exact schema on the subscriber. The merge process uses these import tables to do its work.

This whole publication thing is working fine. It is performed outside of NHibernate using ADO.NET for batch loading, sets of stored procedures for diff'ing & merging (they're autogenerated by a custom tool). Also, we only have an HTTP link available between master/subscriber to download the data; we can't connect directly to the master SQL server.

The problem I face is visually showing the diff to the user before they actually merge the new data. In the application, I'd like to have NHibernate load our business object directly from these temporary import tables. Can we do this ? Without having to maintain two sets of almost identical mapping files ?

In our last version, we were building up business objects using custom code that would load from these import tables. It would only load simple properties, not handling relations. This sucks big time from a coding/maintenance point of view.

+1  A: 

Are you trying to do something like this where you need to dynamically change the table names?

You may also want to look at Fluent NHibernate for a solution.

Another possibility would be to have the temporary tables in a separate database and just change the connection string.

Jamie Ide