Hibernate Many to one updating foreign key to null

淺唱寂寞╮ 提交于 2019-11-28 09:32:55
JB Nizet

You don't have a bidirectional association here. You have two independent associations, each incorrectly mapped to the same column.

In a bidirectional association, you must always have an owner side, and an inverse side. The inverse side is marked using the mappedBy attribute. In a OneToMany association, the inverse side must be the one-side:

@OneToMany(mappedBy="ideaProfile", fetch=FetchType.EAGER, cascade=CascadeType.ALL)
private List<Pitch> pitchs;

...

@ManyToOne
@JoinColumn(name = "ideaProfileId")
private IdeaProfile ideaProfile;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!