Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

hibernate onetone with mapsid

@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;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #hibernate #onetone #mapsid
ADD COMMENT
Topic
Name
6+3 =