aspose file tools*
The moose likes Object Relational Mapping and the fly likes join tables from different schema in jpa Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "join tables from different schema in jpa" Watch "join tables from different schema in jpa" New topic
Author

join tables from different schema in jpa

sangeetha krishnamurthi
Greenhorn

Joined: Oct 31, 2007
Posts: 7
Hi,

I am using ejb3 amd i want to join two tables which are present in different schemas.how to do that in jpa.let me know some sites where i can find some examples for join.

Regards,
Sangeetha
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I'm not sure about its use in JPA, but it can be done in general by fully qualifying the schema.table in queries. It will only work if the user has access to all schemas. It's not a good idea though, and the only time I have needed to do it, we found it easier to import the table temporarily, run the queries and drop the table.
sangeetha krishnamurthi
Greenhorn

Joined: Oct 31, 2007
Posts: 7
Hi david,

i tried the same way you said i was able to execute that query in oracle but while mapping to my entity i am wrong somewhere. could you provide me a example for joining two tables with object relational mapping.

thanks
sangeetha
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

This is what I mean about its usage in JPA - I'm not sure it is supported.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

It isn't supported, so to speak. You can always create an SQLQuery instead of hoping for any mapping solution.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: join tables from different schema in jpa
 
Similar Threads
how to show records in jsp
polymormsim related demos
Join between tables in different databases
Good idea or not - 1 Entity Bean, multiple tables?
Query on BMP