-->
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.  [ 1 post ] 
Author Message
 Post subject: Multiple database joins
PostPosted: Fri Feb 11, 2005 2:22 pm 
Newbie

Joined: Fri Feb 11, 2005 2:13 pm
Posts: 11
I have seen one post on this, but there was no answer.

Is it possible in Hibernate to do a cross database join using either HQL or Criterias?

For example if I have 2 databases, db1 and db2. In db1, I have a table with Customers and in db2 I have a table with Invoices. The invoice simply has the id for the customer, thus in order to get any customer information, I have to join with it. Simple enough.

I am using for infomix, thus the raw SQL would be:

select i.* from db2:invoice i , db1:customers cwhere i.customer_id = c.id

The SQL is simple, but I have no idea on how to do it with HQL or Criterias, either in hibernate2 or hibernate3. Is it possible?

Thanks in advance!


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

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.