开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜