• Post Reply Bookmark Topic Watch Topic
  • New Topic

Mutiple DBs and one Session Factory???

 
Thillai Sakthi
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All:
I am new to hibernate. Need a quick help please.........
I wish to show a report joining two tables - these tables are in different databases. As multiple DBs are used, I have created two .cfg.xml files and loaded them manually for Configuration and SessionFactories....
With two different SessionFactories, dont know how do I query and get data???

Any help would be highly appreciated.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate cannot map related tables where the tables are in two different DBs. You need to look at your DB docs about cross database relationships.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!