title: JPA2 error validation : state field cannot be resolved
body: <p>I have a error that I can not get rid of, but the code works in the same time.</p>
  
  <pre><code>@NamedQuery(name="getDocteur", query="SELECT d FROM Clinique cli, IN (cli.docteurs) AS d WHERE cli.clinique_ID=:clinique_ID AND d.docteur_ID=:docteur_ID")
  </code></pre>
  
  <p>the Error Eclipse give me is this : </p>
  
  <blockquote>
    <p>The state field path 'd.docteur_ID' cannot be resolved to a valid
    type.</p>
  </blockquote>
  
  <p>I got the same error with this query too</p>
  
  <pre><code>@NamedQuery(name="validUsername", query="SELECT u FROM Clinique cli, IN (cli.users) AS u WHERE cli.clinique_ID=:clinique_ID AND u.username=:username AND u.password=:password")
  
  
  
  User.java 
  ...
  
  @Column(name="PASSWORD", nullable=false)
      @NotNull
      @Size(min=8, max=8)
      private String password;
  
  
  
  Docteur.java
  
  package com.jerabi.model;
  
  import java.io.Serializable;
  import javax.persistence.*;
  import javax.validation.constraints.NotNull;
  import javax.validation.constraints.Size;
  
  import java.util.ArrayList;
  import java.util.List;
  
  
  /**
   * The persistent class for the docteur database table.
   * 
   */
  @Entity
  @Table(name="Docteur",
          uniqueConstraints={@UniqueConstraint(columnNames={"clinique_Clinique_ID", "nom", "prenom"})}
  )
  public class Docteur implements Serializable {
      private static final long serialVersionUID = 1L;
  
  @Id 
  @GeneratedValue(strategy=GenerationType.IDENTITY)
  @Column(name="DOCTEUR_ID")
  private Integer docteur_ID;
  
  @Column(name="Nom", nullable=false)
  @NotNull
  @Size(min=1, max=40)
  private String nom;
  
  @Column(name="Prenom", nullable=false)
  @NotNull
  @Size(min=1, max=40)
  private String prenom;
  
  @ManyToOne(optional=false)
  private Clinique clinique;
  
  //bi-directional many-to-one association to Patient
  @OneToMany(cascade={CascadeType.PERSIST, CascadeType.MERGE, CascadeType.DETACH}, orphanRemoval=false, mappedBy="docteur")
  private List&lt;Patient&gt; patients;
  
  public Docteur() {
      patients = new ArrayList&lt;Patient&gt;();
  }
  
  public Integer getDocteur_ID() {
      return this.docteur_ID;
  }
  
  public void setDocteur_ID(Integer docteurId) {
      this.docteur_ID = docteurId;
  }
  
  public String getNom() {
      return this.nom;
  }
  
  public void setNom(String nom) {
      this.nom = nom;
  }
  
  public String getPrenom() {
      return this.prenom;
  }
  
  public void setPrenom(String prenom) {
      this.prenom = prenom;
  }
  
  public List&lt;Patient&gt; getPatients() {
      return this.patients;
  }
  
  public void setPatients(List&lt;Patient&gt; patients) {
      this.patients = patients;
  }
  
  public Clinique getClinique() {
      return clinique;
  }
  
  public void setClinique(Clinique clinique) {
      this.clinique = clinique;
  }
  
  }
  </code></pre>