title: Caused by: java.sql.SQLException: Column ' ' not found
body: <p>I have strange situation, with hibernate I am generating native/sql query for getting data from dinamic table, tables are generated from code so I have not entities for each table, I find tables by prefix. So generated query working well when I run it in mysql console, but with hibernate when I try to fetch data and map it to one general entity I am always have exception about missing column.</p>
  
  <pre><code> SQLQuery query1 = getSession().createSQLQuery(sqlLinked.toString());  
       List&lt;MyGlobalEntity&gt; objectList = (List&lt;MyGlobalEntity&gt;) query1
           .addEntity(MyGlobalEntity.class).list();
  </code></pre>
  
  <p>Hibernate complained like </p>
  
  <pre><code>org.hibernate.exception.SQLGrammarException: could not execute query
  Caused by: java.sql.SQLException: Column 'col name' not found.
  </code></pre>
  
  <p>But global entity have all fields which have generated entities.
  And SQL worked wee from console.</p>
  
  <p>Who can suggest something?</p>
  
  <p>here is a query , short version</p>
  
  <pre><code>select *  from g_table where  id &gt; 0 AND  x_5 &gt;='2001-12-31'
  </code></pre>
  
  <p>Thanks.</p>