我抽出两张表格和一张表格:工作人员、叙级和工作人员叙级。 在合并表一中,有一门大豆:显示。 我的意思如下:
/**
* @ManyToMany(targetEntity="Staff", inversedBy="classifications")
* @JoinTable(name="staff_classifications",
* joinColumns={@JoinColumn(name="staffid", referencedColumnName="id")},
* inverseJoinColumns={@JoinColumn(name="classificationid", referencedColumnName="id", unique=true)});
*/
- How do I add the extra field showclassifications to the join table?
- How do I reference the field via DQL? E.g. What query would get all of a staff s classifications that are allowed to be shown?
- Do I place the above annotation in one class and a @ManyToMany annotation with no @joinTable in the other? E.g. @ManyToMany (targetEntity="Classification")?