Hibernate one-to-one mapping between 2 subclasses
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.
精彩评论