【问题标题】:Hibernate+JPA One To One relationshipHibernate+JPA 一对一关系
【发布时间】:2010-08-16 05:22:46
【问题描述】:

我有这样的 OneToOne 关系:-

Person                            Others
-----------                      ------------- 
| id  (PK) |  <----------------->| id(PK)(FK) |
-----------                      -------------
| name     |                     |....        |
| address  |                     |....        |
| ....     |                     |....        |

这里 person 表的 id 是自动生成的,但 Others 表的 id 是外键。如何链接这两个表。

【问题讨论】:

标签: hibernate jpa relationship one-to-one


【解决方案1】:

你可以忘记外键的东西,继续保持正常的一对一映射关系。更多细节how to connect two tables when one has no primary key

【讨论】:

    猜你喜欢
    • 2010-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-30
    • 2011-08-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多