We can't change bad legacy db design but must implement modification of composite keys. Personally I am not working on this segment, but we cannot make it run (screams "key changed" when updated). Is there something bad in the mapping? This class and table are only many-to-many substitution and because of additional parameters we need to have that class and access the table.
Thanks
Rimmer
Hibernate version: 2.1
Mapping documents:
Code:
<class
name="net.buildercom.admin.hibernate.Torganizationuser"
table="TORGANIZATIONUSERS"
>
<composite-id name="comp_id" class="net.buildercom.admin.hibernate.TorganizationuserPK">
<key-property
name="fuserid"
column="FUSERID"
type="java.lang.Long"
length="10"
>
</key-property>
<key-property
name="forganizationid"
column="FORGANIZATIONID"
type="java.lang.Long"
length="10"
>
</key-property>
</composite-id>
...
<!-- Associations -->
<!-- derived association(s) for compound key -->
<!-- bi-directional many-to-one association to Torganization -->
<many-to-one
name="torganization"
class="net.buildercom.admin.hibernate.Torganization"
update="false"
insert="false"
>
<column name="FORGANIZATIONID" />
</many-to-one>
<!-- bi-directional many-to-one association to Tuser -->
<many-to-one
name="tuser"
class="net.buildercom.admin.hibernate.Tuser"
update="false"
insert="false"
>
<column name="FUSERID" />
</many-to-one>
<!-- end of derived association(s) -->
</class>
</hibernate-mapping>