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!
|