title: A Foreign key refering has wrong number of columns
body: <p>I got a problem with JPA and ManyToMany association.</p>
  
  <p>I got two class FOA_PARAM_EMPLOYE and FOA_PARAM_POSITION, and an association table FOA_PARAM_EMPLOYE_POSITION.</p>
  
  <p>Class FoaParamEmploye :</p>
  
  <pre><code>@Entity
  @Table(name = "FOA_PARAM_EMPLOYE")
  @NamedQuery(name = "FoaParamEmploye.findAll", query = "SELECT f FROM FoaParamEmploye f")
  public class FoaParamEmploye implements Serializable {
  private static final long serialVersionUID = 1L;
  
  @EmbeddedId
  private FoaParamEmployePK id;
  
  @Column(name = "ACTEUR_MAJ_OCCUR")
  private String acteurMajOccur;
  
  @Column(name = "ADRESSE_EMAIL")
  private String adresseEmail;
  
  // bi-directional many-to-many association to FoaParamPosition
  @ManyToMany
  @JoinTable(
          name = "FOA_PARAM_EMPLOYE_POSITION", 
          joinColumns = { @JoinColumn(name = "ID_EMPLOYE"),
                          @JoinColumn(name = "COD_ENTREP") }, 
          inverseJoinColumns = { @JoinColumn(name = "ID_POSITION")
  })
  private List&lt;FoaParamPosition&gt; foaParamPositions;
  
  public FoaParamEmployePK getId() {
      return this.id;
  }
  
  public void setId(FoaParamEmployePK id) {
      this.id = id;
  }
  
  public String getActeurMajOccur() {
      return this.acteurMajOccur;
  }
  
  public void setActeurMajOccur(String acteurMajOccur) {
      this.acteurMajOccur = acteurMajOccur;
  }
  
  public String getAdresseEmail() {
      return this.adresseEmail;
  }
  
  public void setAdresseEmail(String adresseEmail) {
      this.adresseEmail = adresseEmail;
  }
  
  public List&lt;FoaParamPosition&gt; getFoaParamPositions() {
      return foaParamPositions;
  }
  
  public void setFoaParamPositions(List&lt;FoaParamPosition&gt; pFoaParamPositions) {
      this.foaParamPositions = pFoaParamPositions;
  }
  }
  </code></pre>
  
  <p>Class FoaParamPosition :</p>
  
  <pre><code>@Entity
  @Table(name="FOA_PARAM_POSITION")
  @NamedQuery(name="FoaParamPosition.findAll", query="SELECT f FROM FoaParamPosition f")
  public class FoaParamPosition implements Serializable {
  private static final long serialVersionUID = 1L;
  
  @EmbeddedId
  private FoaParamPositionPK id;
  
  @Column(name="ACTEUR_MAJ_OCCUR")
  private String acteurMajOccur;
  
  @Column(name="CD_PROFIL_AFFECTATION")
  private String cdProfilAffectation;
  
  // bi-directional many-to-many association to FoaParamEmploye
  @ManyToMany
  private List&lt;FoaParamEmploye&gt; foaParamEmployes;
  
  public FoaParamPositionPK getId() {
      return this.id;
  }
  
  public void setId(FoaParamPositionPK id) {
      this.id = id;
  }
  
  public String getActeurMajOccur() {
      return this.acteurMajOccur;
  }
  
  public void setActeurMajOccur(String acteurMajOccur) {
      this.acteurMajOccur = acteurMajOccur;
  }
  
  public String getCdProfilAffectation() {
      return this.cdProfilAffectation;
  }
  
  public void setCdProfilAffectation(String cdProfilAffectation) {
      this.cdProfilAffectation = cdProfilAffectation;
  }
  
  public List&lt;FoaParamEmploye&gt; getFoaParamEmployes() {
      return foaParamEmployes;
  }
  
  public void setFoaParamEmployes(List&lt;FoaParamEmploye&gt; pFoaParamEmployes) {
      this.foaParamEmployes = pFoaParamEmployes;
  }
  }
  </code></pre>
  
  <p>Table FOA_PARAM_EMPLOYE_POSITION has this columns :</p>
  
  <pre><code>COD_ENTREP
  ID_EMPLOYE
  ID_POSITION
  XQCIF
  ACTEUR_MAJ_OCCUR
  DATE_HEURE_MAJ_OCCUR
  </code></pre>
  
  <p>I got this exception :</p>
  
  <pre><code>A Foreign key refering com.groupama.middlgan.entities.FoaParamPosition from
  com.groupama.middlgan.entities.FoaParamEmploye has the wrong number of column. 
  should be 2
  </code></pre>
  
  <p>If I add COD_ENTREP on <code>inverseJoinColumns</code> in my FoaParamEmploye entity, I got this exception :</p>
  
  <pre><code>Repeated column in mapping for collection: 
  com.groupama.middlgan.entities.FoaParamEmploye.foaParamPositions column: COD_ENTREP
  </code></pre>
  
  <p>Any idee ?</p>