Hi,
I have a table which has the following structure.
currency varchar2(4),
amount1 double,
amount2 double
My Object model looks something like below
class Something {
Amount amount1;
Amount amount2;
}
class Amount {
String currency;
double amount;
}
I would like to map the single column currency to each amount field.
my hbm looks something like below
<component name="amount1" type="Amount">
<property name="currency" column="currency">
<property name="amount" column="amount1">
<component>
<component name="amount2" type="Amount">
<property name="currency" column="currency" insert="false" update="false">
<property name="amount" column="amount1">
<component>
Though the schemaexport utility works fine with this, at run time I get a mapping exception.
Any help would be greatly appreciated.
Thanks
|