It seems you have a One(list)ToMany(tasks) relationship, therefore a bridge table is not needed.
A bridge table is always needed in case of Many(list)ToMany(tasks).
You must read java persistance with hibernate.
Class ListsCode:
@Entity
public class Lists {
int list_id;
Set<Tasks> tasks;
@Id
public int getList_id() {
return list_id;
}
@OneToMany
@JoinColumn
public Set<Tasks> getTasks() {
return tasks;
}
public void setList_id(int listId) {
list_id = listId;
}
public void setTasks(Set<Tasks> tasks) {
this.tasks = tasks;
}
}
Class TasksCode:
@Entity
public class Tasks {
int rule_id;
String ruleInfo1;
String ruleInfo2;
@Id
public int getRule_id() {
return rule_id;
}
public String getRuleInfo1() {
return ruleInfo1;
}
public String getRuleInfo2() {
return ruleInfo2;
}
public void setRule_id(int ruleId) {
rule_id = ruleId;
}
public void setRuleInfo1(String ruleInfo1) {
this.ruleInfo1 = ruleInfo1;
}
public void setRuleInfo2(String ruleInfo2) {
this.ruleInfo2 = ruleInfo2;
}
}
best regards.