I have multiple mysql databases running on the same MySQL server. So for example I have databases A, B, and C.
In MySQL you can specify a database name as part of a table (regardless of which MySQL database you're connected to) to do cross-database operations. So I could do the following:
mysql -uuser C <-- connects to database C
select * from A.table1 t1, B.table2 t2 where t1.id = t2.table1_id
which joins across databases A and B even though I'm connected to C.
Is it then OK to use one hibernate session factory to connect to say database C and then in the mapping file specify the table name as A.table1 and B.table2? Or are there some issues to be concerned with using this approach?
Thanks,
Todd
|