I just started getting the '..cannot simultaneously fetch multiple bags..' error. My code that I have been using to map is below:
Code:
@ManyToMany(fetch=FetchType.EAGER)
@JoinTable(name = "PlanOptionPlanOptionSection", joinColumns = @JoinColumn(name = "PlanOptionId"), inverseJoinColumns = @JoinColumn(name = "PlanOptionSectionId"))
List<PlanOptionSection> planOptionSections = new ArrayList<PlanOptionSection>();
If I want to add the @IndexColumn to prevent this error, do I need to add a new column to mysql table which is called 'PlanOptionPlanOptionSection'?
right now the table 'PlanOptionPlanOptionSection' looks like this:
ID: <PK>
PlanOptionId: INT(10)
PlanOptionSectionId: INT(10)
this is what I was thinking of changing it to:
Code:
@ManyToMany(fetch=FetchType.EAGER)
@JoinTable(name = "PlanOptionPlanOptionSection", joinColumns = @JoinColumn(name = "PlanOptionId"), inverseJoinColumns = @JoinColumn(name = "PlanOptionSectionId"))
@IndexColumn(name = "index", base = 1)
List<PlanOptionSection> planOptionSections = new ArrayList<PlanOptionSection>();
I was just getting some errors when I tried to do this and I was unsure if I set it up right and what if any, my MySQL table should look like
with the join table.