hibernate学习:一对一单向联合外键

一:例子


二:总结

Wife有联合外键WifePK

在Husband对象中
@OneToOne
@JoinColumns({ @JoinColumn(name = "wife_id", referencedColumnName = "id"),
@JoinColumn(name = "wife_name", referencedColumnName = "name") })
private Wife wife;

你可能感兴趣的:(Hibernate,外键)