This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Mutiple DBs and one Session Factory???  RSS feed

 
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!