title: not all named parameters have been set hibernate in createSQLQuery
body: <p>I am getting the error of <strong>not all named parameters have been set</strong>. Below is my code.</p>
  
  <p>my SqlQuery which is running fine at mysql prompt, You can refer schema in the question <a href="https://stackoverflow.com/questions/12595841/sql-select-query-help-required">SQL Query</a></p>
  
  <pre><code>SELECT  t.*
  FROM    (
      SELECT  @lim := 2,
              @cg := ''
      ) vars,
      (select * from Table1 order by product,amount, make)  t
  WHERE   CASE WHEN @cg &lt;&gt; product THEN @r := @lim ELSE 1 END &gt; 0
      AND (@r := @r - 1) &gt;= 0
      AND (@cg := product) IS NOT NULL
  ORDER BY
      product,amount, make
  </code></pre>
  
  <p>my java code</p>
  
  <pre><code>try {
               context.dbl.startTransaction();
               Session session = context.dbl.getSession();
  
               //String sqlQuery = "from com.infibeam.inventoryservice.dbObjects.PopularBrandDO";
               String sqlQuery = "SELECT  t.* ";
               sqlQuery=sqlQuery + "FROM    (";
               sqlQuery=sqlQuery + "SELECT  @lim := 2,";
               sqlQuery=sqlQuery + "@cg := ''";
               sqlQuery=sqlQuery + ") vars, ";
               sqlQuery=sqlQuery + "(select * from Table1 order by product,amount, make) t";
               sqlQuery=sqlQuery + " WHERE   CASE WHEN @cg &lt;&gt; product THEN @r := @lim ELSE 1 END &gt; 0";
               sqlQuery=sqlQuery + " AND (@r := @r - 1) &gt;= 0 ";
               sqlQuery=sqlQuery + " AND (@cg := product) IS NOT NULL ";
               sqlQuery=sqlQuery + " ORDER BY product,amount, make";
               //Query query = session.createQuery(sqlQuery);
               SQLQuery query = session.createSQLQuery(sqlQuery);
               listItems = query.list();
  
  
              }catch(RuntimeException e) {
                  e.printStackTrace();
              }
  </code></pre>
  
  <p>Below is the exception i am getting</p>
  
  <pre><code>org.hibernate.QueryException: Not all named parameters have been set: [] [SELECT  t.* FROM    (SELECT  @lim := 2,@cg := '') vars, (select * from Table1 order by product,amount, make) t WHERE   CASE WHEN @cg &lt;&gt; product THEN @r := @lim ELSE 1 END &gt; 0 AND (@r := @r - 1) &gt;= 0  AND (@cg := product) IS NOT NULL  ORDER BY product,amount, make]
      at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:291)
      at org.hibernate.impl.SQLQueryImpl.verifyParameters(SQLQueryImpl.java:199)
      at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:143)
      at com.infibeam.weaverbird.helper.PopularBrandFacetHelper.bootstrap(PopularBrandFacetHelper.java:48)
  </code></pre>
  
  <p>Thanks in advance...</p>