title: could not locate named parameter: Using setParameterList
body: <p>I am getting following error:  </p>
  
  <pre><code>org.hibernate.QueryParameterException: could not locate named parameter [projects]
      at org.hibernate.engine.query.spi.ParameterMetadata.getNamedParameterDescriptor(ParameterMetadata.java:148)
      at org.hibernate.engine.query.spi.ParameterMetadata.getNamedParameterExpectedType(ParameterMetadata.java:165)
      at org.hibernate.internal.AbstractQueryImpl.determineType(AbstractQueryImpl.java:523)
      at org.hibernate.internal.AbstractQueryImpl.setParameterList(AbstractQueryImpl.java:892)
      at com.pepsico.trackwise.sqa.job.ActivityProcessor.execute(ActivityProcessor.java:117)
      at org.quartz.core.JobRunShell.run(JobRunShell.java:207)
      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:560)
  </code></pre>
  
  <p>This my Query:  </p>
  
  <pre><code>&lt;sql-query name="findRecordsByPerson"&gt;
      &lt;return-scalar column="prId" type="java.lang.Integer"/&gt;
  
      SELECT pr.id AS prId
      FROM pr
      INNER JOIN project pj ON pr.project_id=pj.id
      INNER JOIN pr_addtl_data PAD ON pr.id=PAD.pr_id
      INNER JOIN data_fields df ON df.id=PAD.data_field_id
      WHERE df.field_class IN (7, 16)
        AND PAD.n_value = :pid
        AND pj.name IN (:projects)
      UNION
      SELECT pr.id AS prId
      FROM pr
      INNER JOIN project pj ON pr.project_id=pj.id
      WHERE originator_rel_id=:pid
        AND pj.name IN (:projects)
  
  &lt;/sql-query&gt;  
  </code></pre>
  
  <p>This is my code:  </p>
  
  <pre><code>List prList = db.getNamedQuery("findRecordsByPerson")
                                  .setInteger("pid", pid)
                                  .setParameterList("projects", Arrays.asList(new String[]{Constants.PROJECT_SUPPLIER_SITE, Constants.PROJECT_SUPPLIER_SITE_APPROVAL,
                                          Constants.PROJECT_SUPPLIER_SITE_AUDIT, Constants.PROJECT_SUPPLIER_SITE_MATERIAL}))
                                  .list();
  </code></pre>
  
  <p>I have checked all available answers give in this forum. Syntactically i find my code correct m not sure what is missing here. Please help.</p>