JPA: Foreign key that is also a primary key mapping

前端 未结 4 544
Happy的楠姐
Happy的楠姐 2020-12-09 10:05

I have been trying to solve this for whole day but no luck! Also i tried to read most of the tutorials on the net but as you all know they all are full of useless examples t

4条回答
  •  無奈伤痛
    2020-12-09 10:18

    You can map your classes for example with Netbeans. It will generate annotations. The problem could be your dao layer. You have to persist objects in correct way. For example can't save travelExtra without Vehicle. Also be aware of owning side.

提交回复
热议问题