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
|