title: Hibernate namedquery error-parameter id does not exist as a named parameter in [from Employeenam e where e.name=:name]
body: <p>I have two classes,a POJO and a main class and i'm working with named query with annotation in hibernate.</p>
  
  <p>the POJO class is as follows</p>
  
  <pre><code>@NamedQueries(
          {
              @NamedQuery(
                      name="findEmployeeName",
                          query="from Employeenam e where e.name=:name" 
                      )
          }
  )
  @Entity
  @Table(name = "employee")
  public class Employeenam {
  
      // public String tostring(){return id+" " +name+ " " +salary+ " " +job;}
  
      @Id
      @GeneratedValue
      @Column(name = "id")
      int id;
  
      @Column(name = "name")
      String name;
  
      @Column(name = "salary")
      int salary;
  
      @Column(name = "job")
      String job;
  
      public int setId() {
          return id;
      }
  
      public void getId(int Id) {
          this.id = Id;
      }
  
      public String setName() {
          return name;
      }
  
      public void getName(String Name) {
          this.name = Name;
      }
  
      public int getSalary() {
          return salary;
      }
  
      public void setSalary(int Salary) {
          this.salary = Salary;
      }
  
      public String setJob() {
          return job;
      }
  
      public void getJob(String Job) {
          this.job = Job;
      }
  
  }
  </code></pre>
  
  <p>and the main class as:</p>
  
  <pre><code>public class FetchData {
      public static void main(String[] args) {
  
          Configuration configuration = new Configuration();
          configuration.configure("hibernate.cfg.xml");
          SessionFactory sfactory = configuration.buildSessionFactory();
          Session session = sfactory.openSession();
          Query query = session.getNamedQuery("findEmployeeName");
          query.setString("name", "dfdsf");
          Employeenam e = new Employeenam();
          List&lt;Employeenam&gt; empList = query.list();
          session.close();
      }
  }
  </code></pre>
  
  <p>I am getting the following error as </p>
  
  <pre><code>Parameter id does not exist as a named parameter in [from Employeenam e where 
   e.name=:name]
  </code></pre>
  
  <p>Can someone please help me with this.. where am i going wrong AGAIN??</p>