I have a class A
that has a set of B
's. However, these two objects are linked by fields that are NOT the primary key.
For B
, I can use <key column>
, but how do I specify that the join should be in A
.secondary_column
? Not A
.table_primary_key_id
?
<class table="a">
<id column="table_primary_key_id">
</id>
<property column="secondary_column" />
<set table="B" lazy="false" >
<key column="B_not_primary" />
<one-to-many class="BClass" />
</set>
</class>
Solved with