The usual response to db-specific query structures, such as queries from a cross-database, is to create a view of the "local" database (to which NH connects), which will execute the cross-database query and return the combined results. You can also have a repository for each database and develop some tools for querying records from each database and combining them manually.
One thing that will also work; the table property for each display is just a string and can be anything; NHibernate simply takes this and connects it wherever it needs to refer to the table name. So, you can try to specify tables in mappings using their fully qualified names: ConnectedDB..LocalTable, OtherDB..RemoteTable. This can be considered a hack, but it is also quite elegant; your program does not even need to know that there are several databases in the save scheme.
source share