title: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException MS-Sql Server
body: <p>I am using hibernate for fetch data from ms-sql server database .I am using below query to retrieve data from table as: </p>
  
  <pre><code>"select tw.datestr, Round (tw.s1n301Kwh,0)  
  from Tower_3_EB_kwh tw 
  order by tw.datestr DESC"
  </code></pre>
  
  <p>But I got this error:</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: <strong>Tower_3_EB_kwh</strong> is not mapped [select tw.datestr, Round (tw.s1n301Kwh,0) from Tower_3_EB_kwh tw order by tw.datestr DESC]</p>
  </blockquote>
  
  <p>I am using hibernate code to fetch data from table as:</p>
  
  <pre><code>String queryString = "select tw.datestr, Round (tw."+columnName.toLowerCase()+"Kwh"+",0)  
     from "+"Tower_"+blockName.substring(blockName.length() - 1)+"_EB_kwh tw 
     order by tw.datestr DESC";
  
  Query query = entityManager.createQuery(queryString);           
  List&lt; "?" &gt;  list = query.setMaxResults(1).getResultList()
  </code></pre>
  
  <p>Can anyone explain what is issue in query so that i am not enable to fetch data from database . </p>