I am having the same problem.
Basic set-up:
I have a "simple table" with three columns, where one column is a foreign key into "other table". I want to map a value in my javabean class to a column in the "other table", using "simple table"'s foreign key, the "other table"'s primary key, and using a column in the "other table" as value for my property.
Simple table hbm:
<join table="OTHER_TABLE" inverse="true">
<key column="PRIMARY_IN_OTHER_TABLE" property-ref="myForeignKeyProperty"/>
<property name="myProperty" type="java.lang.Long"
update="false" insert="false" column="PROPERTY_COLUMN_IN_OTHER_TABLE"/>
</join>
i have tried both the object-property and the table column name for "property-ref" but it seems to ignore it and always use "simple table"'s primary key at all times.
If someone, perhaps from hibernate, could point out if there is something i have misunderstood, or if this is a known bug, i'd by very very happy.
|