Hibernate+JPA One To One relationship
I have a OneToOne relationship like this :-
Person Others
----------- -------------
| id (PK) | <----------------->| id(PK)(FK) |
----------- -------------
| name | |.... 开发者_StackOverflow社区 |
| address | |.... |
| .... | |.... |
Here person table's id is auto-generated, but Others table's id is a foreign key. How can I link these two tables.
You can forget about the foreign key stuff and keep coninue in normal one to one mapping relation.For more details how to connect two tables when one has no primary key
精彩评论