-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: database qualification at runtime?
PostPosted: Tue Oct 21, 2003 3:00 pm 
Newbie

Joined: Tue Oct 07, 2003 4:17 pm
Posts: 9
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 21, 2003 4:02 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
This will work iff you rebuild the SessionFactory.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.