title: Hibernate HQL query
body: <p>I am trying to create HQL query with multiple where paramteres like</p>
  
  <pre><code>result = sessionFactory.getCurrentSession().createQuery("from County where " + [0].property + "=?"+","+ c[1].property + "=?")
  </code></pre>
  
  <p>.setParameter(0, c[0].value)<br>
  .setParameter(1, c[1].value).list();</p>
  
  <p>instead of doing this I am trying to create a query that can handle any number of paramters like </p>
  
  <pre><code>for(Params c:parms){`enter code here`
      queryString+= c.property +" = "+c.value+",";
      }
  result = (State) sessionFactory.getCurrentSession()
                  .createQuery("from County where " +queryString)
                  .list().get(0);
  </code></pre>
  
  <p>There query looks correct but it says "cannot execute query" </p>