Hi,
Well i just had to use that attribute myself there in order to get past a hump.
Was trying to link two tables on columns which weren't actually constrained to each other in any way.
It was just business logic that maintained the constraint, which isn't ideal but nothing i can do about that.
So in order to link the columns, i used property-ref in order to tell Hibernate the actual column i wanted to link on.
Here's the code i used:
<set name="relatedAccounts"
fetch="join">
<key column="DLWC_ACCOUNT_ID" property-ref="dlwcAccountId"/>
<one-to-many class="dnr.gov.wis.model.AccountRoles"/>
</set>
Note: the column is named DLWC_ACCOUNT_ID in both places.
If it was different, you would use the column name of the present class in the column attribute and the Java property name of the other class.
Hope this helps
John
|