Hi everyone,
I am pretty new to hibernate so I got stuck on this issue. I have the following 2 tables (the schemas have come from existing databases and cannot be changed):
Qualification
qual_id --- Pri Key
employee_id
type_id
qualification
description
Qualification_Type
qual_type_id --- Pri Key
qual_type
Qualification is the main table and links to Qualification_Type table via type_id. I want to map these tables to a singal class:
Qualification
qual_id
type
qualification
description
I have got the mapping for everything from the Qualification table working fine but i cannot get the join to work. I have tried the following but i cant get the property ref to work correctly and it seems to always use the qual_id not the type_id:
Code:
<join table="Qualification_type">
<key column="qual_type_id" property-ref="type_id"/>
<property name="type" column="qual_type"/>
</join>
Am I using the correct method? or am i going down the wrong path?
Thank you in advance,
Ed