OneToOne « Key « JPA Q&A





1. OneToOne Using Foreign Key as a Primary Key + Hibernate    stackoverflow.com

We have Two Objects:

 Class Person {
   Long id;
 }

Class MedicalHistory {
  Person person;
}
How should we enable the Person object as the primary key for the MedicalHistory object ...

2. OneToOne between two tables with shared primary key    stackoverflow.com

I'm trying to set up the following tables using JPA/Hibernate:

User:

userid - PK
name 

Validation:

userid - PK, FK(user)
code
There may be many users and every user may have max one validation code or none. Here's ...