I have the following Hibernate mapping (hbm.xml) file:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="org.mycompany.project.SampleItem"
table="MY_TABLE_VIEW" mutable="false">
<composite-id>
<key-property name="version" type="java.lang.String">
<column name="VERSION"/>
</key-property>
<key-property name="itemId" type="java.lang.String">
<column name="ITEM_ID"/>
</key-property>
</composite-id>
<property name="sampleItemValue" type="java.lang.String">
<column name="SAMPLE_ITEM_VALUE"/>
</property>
</class>
</hibernate-mapping>
I need run time (programmatically) to change the ‘table’ attribute:
table="MY_OTHER_TABLE_VIEW". How can I do it (if at all)?