Hi,
I might be lacking in my knowledge as following might be expected behavior.
I want to persist an object of class Position which is has a member of class Balance as follows:
Class Position{
private balance = new Balance();
}
where
Class Balance{
private Map money = new HashMap();
}
Now my mapping file for above is as follows:
Code:
<class name="Position" table="tbl_position">
...
<many-to-one name="balance" class="Balance"
column="balance_id"
cascade="all"
unique="true"/>
...
</class>
<class name="Balance" table="tble_balance">
<id name="id" column="balance_id">
...
</id>
<map name="monetary" table="tbl_money">
...
</map>
</class>
Now the problem is, above mapping results in 3 tables. but my second table tble_balance is having just one column balance_id.
Is it possible to avoid this table(
without changing the java object structure) as I can have balance_id column in tbl_money and work with just 2 tables?
I know if money Map is direct member of Position(as follows), it will result in 2 tables but I can't change java object.
Class Position{
private Map money = new HashMap();
}
Kindly share your information.
Thanks & Regards.