JPA Inheritance

后端 未结 4 390
花落未央
花落未央 2021-01-14 17:11

Hi I\'m new to JPA and I\'m having trouble understanding how it handles inheritance.

I have a specific problem I need solved without changing the DB scheme, but if y

4条回答
  •  一整个雨季
    2021-01-14 17:53

    You are trying to use java inheritance concept while creating the db tables, which is somewhat not possible in this case. I could think one different approach for this problem. Have table fruit_type and fruit. fruit_type(id, typename,desc) fruit(id, name, type_id, desc) here type_id will be the foreign key.

提交回复
热议问题