Hi Everybody,
I have a question about my config and the catalog attribute in the hbm.xml files. Currently, I have three databases that I'm accessing simultaneously, so I have three different hibernate config files that have something like this:
<property name="connection.url"> jdbc:oracle:thin:@machineA:some_port:foo</property>
<property name="connection.url"> jdbc:oracle:thin:@machineA:some_port:bar</property>
<property name="connection.url"> jdbc:oracle:thin:@machineA:some_port:foobar</property>
I saw a post that eluded to catalog attribute in the individual hbm.xml files.
viewtopic.php?f=1&t=961448 (The second from the last posting - by jherbst)
My question is could we combine the three configuration files down to one and by pushing the database name down to the in hbm.xml files and have Hibernate figure out which database to go to dynamically? For example:
<property name="connection.url"> jdbc:oracle:thin:@machineA:some_port</property>
In individual hbm.xml files, have something like this:
<class name="a.b.c.d.hibernate.t.t" table="t_name" schema="fooAdmin" catalog="foo">
<class name="a.b.c.d.hibernate.s.s" table="s_name" schema="barAdmin" catalog="bar">
<class name="a.b.c.d.hibernate.u.u" table="u_name" schema="foobarAdmin" catalog="foobar">
Thanks!
Tino