Hello guys,
I am having trouble mapping same class twice within other class. To illustrate the problem lets imagine following scenario:
Code:
@Entity
@Table(name="BODY")
public class Body {
@Id
private Integer id;
@Column
private BloodGroup bloodGroup;
>>>>>>>>>>>>>>> HOW TO MAP THIS PART? <<<<<<<<<<<<<<<<<
private Hand leftHand;
private Hand rightHand;
>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<
// getter and setters ommited
}
@Entity
@Table(name="HAND")
public class Hand {
@Id
private Integer id;
@Column
private String type;
>>>>>>>>>>>>>>> HOW TO MAP THIS PART? <<<<<<<<<<<<<<<<<
private Body body;
>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<
// getter and setters ommited
}
How should the hands (left, right) inside Body class and body inside Hand class be mapped?
Michael