📜  使用 mapid 休眠 onetone - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:27.093000             🧑  作者: Mango

代码示例2
@Entity
public class VitalStats 
{
    @Id @Column(name="vitalstats_id") Long id;

    @MapsId 
    @OneToOne(mappedBy = "vitalStats")
    @JoinColumn(name = "vitalstats_id")   //same name as id @Column
    private Person person;

    private String stats;
}