0
我生成使用基于下图的NetBeans(的EclipseLink JPA)实体:数据未保存在连接表
相关生成的代码是:
Course
@JoinTable(name = "course_software", joinColumns = {
@JoinColumn(name = "course_id", referencedColumnName = "id", nullable = false)}, inverseJoinColumns = {
@JoinColumn(name = "software_id", referencedColumnName = "id", nullable = false)})
@ManyToMany
private List<Software> softwareList;
Software
@ManyToMany(mappedBy = "softwareList")
private List<Course> courseList;
问题出在Course
实体。当我尝试坚持它然后跟随
getFacade().create(currentCourse);
currentCourse.setSoftwareList(selectedSoftware);
记录在course
创建,但在course_software
创建无连接表。
这是如何造成的,我该如何解决?
你想说:_“但没有任何东西被保存在我的course_software连接表”_? – Omar
请原谅我。我编辑了这篇文章。 – jmc