Optional one-to-one mapping in Hibernate

后端 未结 5 1514
旧时难觅i
旧时难觅i 2021-02-18 23:05

How do I create an optional one-to-one mapping in the hibernate hbm file? For example, suppose that I have a User and a last_visited_page table. The user may or may not have a l

5条回答
  •  心在旅途
    2021-02-18 23:14

    Had the same issue, resolved with @OneToOne(optional = true) on the User class (hibernate 5.2.17.Final)

提交回复
热议问题