-->
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.  [ 4 posts ] 
Author Message
 Post subject: Data from tables in two different Schemas
PostPosted: Thu Feb 05, 2009 4:17 pm 
Newbie

Joined: Thu Feb 05, 2009 3:58 pm
Posts: 2
Location: Toronto, Canada
hi!
I am working on migration of BEA Portal to JBoss.
I am using Hibernate and the IDE JBoss Developer Studio.

In Oracle database I have 2 different schemas I want to fetch data from different tables from these two schemas.

Schema 1 : table name ABC

Schema 2: table name XYZ

Can someone help me in writing an HQL query or Hibernate Reverse Engineering using JBoss Developer Studio or MyEclipse.

I tried using my Eclipse it gave me "Please, select tables from a single Schema or Catalog"


Is it possible fetching data from two difffrent tables using a single HQL query???

I want to join the two tables that are in two different schemas using one HQL statement.

Please, any information in this regard is appreciated.

Thanks in Advance.

Take Care


Last edited by khajajamal on Thu Feb 05, 2009 6:03 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 05, 2009 5:48 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Yes it is if your database supports it. I have almost no experience with Oracle, but I know that, for example, with PostgreSQL you can have table in different schemas, but not in different catalogs.

When you define your entities you can provide information about which schema and catalog a certain table lives in. See for http://www.hibernate.org/hib_docs/v3/re ... tion-class for more information.

I have no experience with the reverse engineering tools so I can't help you with that. Maybe it is a limitation in those tools.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 05, 2009 6:08 pm 
Newbie

Joined: Thu Feb 05, 2009 3:58 pm
Posts: 2
Location: Toronto, Canada
nordborg wrote:
Yes it is if your database supports it. I have almost no experience with Oracle, but I know that, for example, with PostgreSQL you can have table in different schemas, but not in different catalogs.

When you define your entities you can provide information about which schema and catalog a certain table lives in. See for http://www.hibernate.org/hib_docs/v3/re ... tion-class for more information.

I have no experience with the reverse engineering tools so I can't help you with that. Maybe it is a limitation in those tools.


Please,
I want to join the two tables in two different schemas using one HQL statement.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 06, 2009 3:14 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Once you have mapped your classes, you no longer have to care about in which schema they live. Hibernate will take care of it. The HQL is the same as if the tables are in the same schema.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.