You have a couple of problems unfortunately.
- Hibernate does not supporting joining across multiple "physical" database instances
- Out of the box, most database don't support joining across multiple "physical" database instances
Fundamentally DBs are only good/performant at joining tables that are in the same database. There are ways of joining across databases but if the size of both tables is big this can be a problem, and peformance may suffer. Do some googling on "oracle join across database" and you'll find some pointers on how to do this but it involves fiddling around with Oracle create a virtual link from one DB to the other.
I would consider either doing the join in memory, if you are comfortable the data set will fit within the memory constraints AND you are only doing this in one special case.
If you'll need to do different joins between these two databases then I would go for a more permanent solution, like the Oracle linking above.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…