Hibernate version: 3.1
Mapping documents:
<hibernate-mapping>
<class name="session.impl.SessionImpl" lazy="true"
proxy="session.Session" >
<subselect>
select distinct SESSION_ID from SESSION_CR
</subselect>
<synchronize
table="session.impl.SessionEntryImpl" />
<id name="sessionID" type="string" column="SESSION_ID" />
<set name="sessionEntries" cascade="none" inverse="true"
fetch="join" table="SESSION_CR">
<key>
<column name="SESSION_ID" />
</key>
<one-to-many
class="session.impl.SessionEntryImpl" />
</set>
</class>
</hibernate-mapping>
If you look in the mapping above, in the <subselect>, I am trying to find a way to dynamically append a schema name onto the database table name. So, for instance, in some cases I need to configure my application to do the subselect on DB1.SESSION_CR and in some cases, I need it to run on DB2.SESSION_CR.
I tried using ${hibernate.default_schema} and configuring that, but Hibernate treats the subselect as a literal string.
I've searched around for quite a bit on here and on google but haven't had much luck. Is there any way to have dynamic properties in mapping files so I can do this? If not, can I change it programatically somewhere?
Thanks in advance,
Matt
|