-->
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: Reverse Engineering DB2 linked table - nickname, alias
PostPosted: Tue Feb 13, 2007 11:16 am 
Newbie

Joined: Sat Mar 05, 2005 2:36 pm
Posts: 19
Hi,

I have a problem when I try to do reverse engineering on a table that is not physically on the same database I connect to. The database server is running DB2.

The table A from schema S is physically in the db X. There is a link between dbs X and Y, so that table B in schema T on db Y resolves to table A in schema S on db X. In clear text this means:

Database X, schema S, table A
Database Y, schema T, table B => resolves to X.S.A

The problem I have is that I cannot generate anything from the table B, connecting to db Y.
Code:
<hibernate-reverse-engineering>
   <table-filter match-schema="T" match-name="B"/>
</hibernate-reverse-engineering>

However, there is no problem when I try to do any SQL query on that table with any JDBC-based client: executing the following SQL query on database Y
Code:
SELECT * from T.B

returns the contents from S.A on database X, as expected.

Is there a known issue, or do I have to set any special options in either hibernate config or the reveng file that I am not aware of? Are aliases and nicknames correctly resolved?

Thank you for your help,
Kariem


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 13, 2007 11:36 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i don't know if db2 metadata returns the proper column/table info for those kind of tables.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 14, 2007 6:24 pm 
Newbie

Joined: Sat Mar 05, 2005 2:36 pm
Posts: 19
How can I find out? My first impression was that it doesn't. Any guides on where I could look or ask? Is it possible that this is an issue with the DB driver or DB version? By the way, the version is 8.2, and the driver is current.

Alternatively, I wanted to follow a different approach: generate the meta-data via the database where the table is physically located. At runtime, the application uses the generated mappings/pojos/whatever and does not really need to access the meta-data, which is apparently not provided for these special tables. What do you think?

Of course, it would be interesting to find a solution instead of a workaround.

Thank you,
Kariem


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 15, 2007 4:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
look in the code ;)

we just use normal jdbc metadata calls to get the information. You can tweak that by providing a specialized implementation of a MetaDataDialect.

Look in the docs for MetaDataDialect.

_________________
Max
Don't forget to rate


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.