JPA Inheritance

后端 未结 4 427
花落未央
花落未央 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 18:00

    I think this is working exactly as designed. When you use joined inheritance and persist an apple object, JPA will automatically insert into both the apple and fruit tables. You don't need to model an additional relation or JoinColumn in your entity classes.

提交回复
热议问题