I'm trying to do an mapping in a table like this
(taken from
http://forum.hibernate.org/viewtopic.ph ... ymanytoone)
Quote:
<class name="com.mjwall.TableD" table="TABLE_D">
<meta attribute="field-description">@hibernate.class
table="TABLE_D"</meta>
<composite-id name="comp_id" class="com.mjwall.TableDPK">
<meta attribute="field-description">@hibernate.id
generator-class="assigned"</meta>
<key-property name="IdA" column="ID_A"
type="java.math.BigDecimal" length="22" />
<key-property name="IdB" column="ID_B"
type="java.math.BigDecimal" length="22" />
<key-property name="IdC" column="ID_C"
type="java.math.BigDecimal" length="22" />
</composite-id>
<many-to-one name="tableC" class="com.mjwall.TableC"
update="false" insert="false">
<column name="ID_A" />
<column name="ID_E" />
</many-to-one>
<many-to-one name="tableB" class="com.mjwall.TableB"
update="false" insert="false">
<column name="ID_A" />
<column name="ID_F" />
</many-to-one>
</class>
notice columns ID_E and ID_F in the associations, that is, ID_A, which is part of primary used in two other associations at the same time. In my application, only who changes the primary key should touch the ID_A, the associations would simple follow the same values. By what I read in the post above, I whoud use update=false and insert=false. Question: does hibernate would allow me to change ID_F and ID_E ? This is legacy databse so I'm trying to find how to map this, any help appreciated.
Quote:
Quote:
[code][/code]