We need to run joins across schemas (some refer to as the database qualifier) which isn't likely much of an issue for Hibernate:
SELECT c.city_name, c.population, b.business_name
FROM myDB.up_city c LEFT OUTER JOIN yourDB.up_business b
ON c.city_name = b.city_name;
The issue is that we don't know the actual values for the different schema qualifiers (myDB and yourDB in the snippet) until runtime. Is anyone aware of an approach that Hibernate could use for this?
Based on our (undereducated) guesses, a likely approach would be to set the schema name of the Table object of the PersistentClass object, as required. Theory is that all hence forth generated SQL would reflect that schema name?
Sounds like a plan?
thanks much for thoughts and pointers.
|