Here is my opinion on the design structure. However, I happen to be a Hibernate newbie so you can take it for what it's worth.
If a candidate could have one and only one skill but a skill could be possessed by many candidates, the relationship between Candidate and Skill would probably be a many-to-one declared in the Candidate.hbm.xml file.
The class structure would probably be something like this.
Code:
public class Candidate
{
public Candidate() {}
private Skill skill = null;
public Skill getSkill()
{
return this.skill;
}
public void setSkill(Skill skill)
{
this.skill = skill;
}
}
The table structure would be something similar to this.
TABLE CANDIDATE
(
CANDIDATEID NUMBER PK
SKILLID NUMBER
...
...
...
FK_SKILLID ASSOCIATED TO SKILL.SKILLID
)
TABLE SKILL
(
SKILLID NUMBER PK
)
The many-to-one mapping in the Candidate.hbm.xml file would be something like this.
Code:
<many-to-one name="skill" column="SKILLID" not-null="true"/>
Hope that helps.