Hi
We have a need to be able to change the owner (schema) of our underlying tables in the .xml mapping files without having to recompile our applications. To clarify consider the below:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="DataAccess.NHibernate.AoDate, .DataAccess.NHibernate"
table="AODATE" schema="TestOwner">
<id name="AsOfDate" column="AS_OF_DATE" type="Date" length="4"> <generator class="assigned"></generator></id>
<property name="ReportingDate" column="REPORTING_DATE" type="Date" length="4"></property>
</class>
</hibernate-mapping>
In the test region of our system we have a development region, a QA region and a region that mirrors prod. These are differentiated by schema name. We need to be able to swap regions based on a config value or the like and not have to hardcode the owner name. Nobody is going to sign off on an app that needs to be recompiled to swap regions - too much risk involved and testing in production is out. Is there an easy way to set the schema value at runtime?
Thanks,
Robin