Say you have an xml mapping with a property element that tries to define a formula like so:
Code:
<hibernate-mapping package="com.foo.mc.data.imsfield">
<class name="ImsField" table="IMS_FIELD" schema="DEMO">
<id name="ID" column="ID" type="long">
<generator class="assigned" />
</id>
<property name="tableName" type="string">
<column name="TABLE_NAME" />
</property>
<property name="fieldName" type="string">
<column name="FIELD_TYPE" />
</property>
<property name="availableNames" formula="(select fieldName from tableName)"/>
</class>
</hibernate-mapping>
The above xml does not work, but what we are trying to do is substitute in the formula the property value for fieldName in the formula as well as property value for tableName in the formula.
So if, for example, the above mapping reflected these values:
Code:
id = 4
tableName = bigtable
fieldName = foo
then the property formula would get translated to:
Code:
select foo from bigtable
Is this possible? And if so, how do we define our formula to grab these elements?