开发者

Hibernate one-to-one mapping between 2 subclasses

开发者 https://www.devze.com 2023-02-13 06:14 出处:网络
How can I make an one-to-one relationship between 2 subclasses wh开发者_JAVA百科en they do not have the ID property? Because each of them was inherited the Id property from superclass so I cannot put

How can I make an one-to-one relationship between 2 subclasses wh开发者_JAVA百科en they do not have the ID property? Because each of them was inherited the Id property from superclass so I cannot put the annotation on them to mapping. And how about when both of them are extends form just one parent?! Thank you.


Just define your mapping as if there where no inheritance involved. It shouldn't matter as long as you don't care about the table and foreign key structure.

If you do care about the tables or if the mapping doesn't work, we need more input on what you are trying to achieve.

0

精彩评论

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