-->
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: Query across databases
PostPosted: Sat Nov 04, 2006 9:17 am 
Newbie

Joined: Fri Oct 20, 2006 5:06 am
Posts: 7
Hi all!

I already tried to get a solution to my problem in the German forum a few days ago, but unfortunately there haven't been any replies yet. I hope there is a solution, so I'll try here again:

I have to make a query across several databases. At the moment, the concept looks thus:

DB1 contains meta-information, i. e. it contains a list of databases in a table called "ExtCorpDBs". In this table, the relevant fields are "Id" and "DbName".

The following mapping for the table does work:

<hibernate-mapping>
<class name="ExtendedCorpus" table="ExtCorpDBs">
<id name="id" type="int" column="Id">
<generator class="increment" />
</id>
<property name="dbName" column="DbName" type="string" />
</class>
</hibernate-mapping>


In this table, every entry points to another database (with the name stored in the DbName field). In this database (DB2) I have stored several tables, but for the moment it would be enough to get the contents from the Table "Sentences". Sentences just contains a list of Ids.

So, my question, basically, is: How do I make my ExtCorp object have a List (or Set or Vector or ...) of Sentence elements from the second database?

I was thinking of creating a SentenceList object. But how do I fill it with my Sentence objects? I have already created a second SessionFactory to use with the second database. But how do I make the connection in the mapping file? Or is that impossible?

Does anybody have an idea?

Thanks in advance for any help.

Johannes


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.