Hi,
I've following class structure:
Code:
public class MainClass {
@Id
@Column(name="MAIN_ID")
private Long id;
@OneToOne(optional=false)
@PrimaryKeyJoinColumn
private PartOne part;
}
public class PartOne{
@Id
@Column(name="MAIN_ID")
private Long mainId;
//other properties
}
public class PartOneDetails {
private Long partOneId;
}
Now, relationship until MainClass and PartOne is fine. However, now I want to make relationship from PartOne to PartOneDetails. Where PartOneDetails will have its own primary key and a foreign key to PartOne.
How should I do this???