title: NetBeans HQL editor wrong translation to SQL
body: <p>I'm trying to access a MySQL database from a Java webservice. I'm using the NetBeans IDE and am following the tutorial <em><a href="http://netbeans.org/kb/docs/web/hibernate-webapp.html" rel="nofollow">Using Hibernate in a Web Application</a></em></p>
  
  <p>Now when I try to test the <a href="http://en.wikipedia.org/wiki/Hibernate_%28Java%29#Hibernate_Query_Language_.28HQL.29" rel="nofollow">HQL</a> query: from calls I get:</p>
  
  <pre><code>org.hibernate.exception.SQLGrammarException: could not execute query
      blablabla
  Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from limit 100' at line 1
      bla, bla, bla
  </code></pre>
  
  <p>And the translated SQL is also wrong:</p>
  
  <pre><code>select  from
  </code></pre>
  
  <p>I created the calls.java class using Hibernate Reverse Engineering.</p>
  
  <p>This is the <code>Hibernate.cfg.xml</code> file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
          &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
          &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
          &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/datacheck&lt;/property&gt;
          &lt;property name="hibernate.connection.username"&gt;admin&lt;/property&gt;
          &lt;property name="hibernate.connection.password"&gt;####&lt;/property&gt;
          &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt;
          &lt;property name="hibernate.current_session_context_class"&gt;thread&lt;/property&gt;
          &lt;property name="hibernate.query.factory_class"&gt;org.hibernate.hql.classic.ClassicQueryTranslatorFactory&lt;/property&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>I can't seem to find the error, and I searched the whole Internet :p</p>
  
  <p>A similar thread is <em><a href="http://forums.netbeans.org/ptopic36999.html" rel="nofollow">HQL Editor not appending table name in query</a></em>.</p>