Does it make sense to have a @OneToOne member contain a @ForiegnKey annotation.
@Entity
class User {
@Id
@GeneratedValue(strategy = IDENTITY)
int id;
@OneToOne
@ForeignKey
@JoinColumn(name = "home_address_id", referencedColumnName = "id")
Address homeAddress;
}
@Entity
class Address {
@Id
@GeneratedValue(strategy = IDENTITY)
int id;
}