title: Parameter does not exist as a named parameter
body: <p>My query is like this:</p>
  
  <pre><code>Query query1 = session.createQuery("select c.email from Contact c where c.contactNo =:contactNo");
      query1.setInteger("contactNo", 22);
  </code></pre>
  
  <p>The error I got is:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.IllegalArgumentException:
    Parameter contactNo does not exist as a named parameter in [select
    c.email from Contact c where c.contactNo = ?]</p>
  </blockquote>
  
  <p>It is working fine with </p>
  
  <pre><code>Query query = session.createQuery("select c.email from Contact c where c.contactNo = ?");
      query.setInteger(0, 22);
  </code></pre>
  
  <p>Why 1st query is not working?</p>