title: PropertyNotFoundException: Could not find setter for column_name on class
body: <p>I am facing the with hibernates named query and transform to bean.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>query = session.getNamedQuery( "LAST_ADDED_DOC" );
  query.setString( "module", inNpUploads.getModuleName() );
  query.setString( "mapping", inNpUploads.getMappingId() );
  query.setResultTransformer( Transformers.aliasToBean( NpUploads.class ) );
  dmsDb = query.list();
  </code></pre>
  
  <p>but the exception is thrown for <code>query.list()</code>:</p>
  
  <pre><code>org.hibernate.PropertyNotFoundException: Could not find setter for doc_id on class com.np.upload.pojo.NpUploads
      at org.hibernate.property.ChainedPropertyAccessor.getSetter(ChainedPropertyAccessor.java:44)
      at org.hibernate.transform.AliasToBeanResultTransformer.transformTuple(AliasToBeanResultTransformer.java:57)
      at org.hibernate.hql.HolderInstantiator.instantiate(HolderInstantiator.java:69)
      at org.hibernate.loader.custom.CustomLoader.getResultList(CustomLoader.java:330)
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
      at org.hibernate.loader.Loader.list(Loader.java:2099)
      at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
      at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
      at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
      at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
      at com.np.upload.manager.FileUploadManager.listUploadedFiles(FileUploadManager.java:116)
      at com.np.upload.spring.controller.FileUploadController.prepareUploadPage(FileUploadController.java:222)
      at com.np.upload.spring.controller.FileUploadController.uploadPage(FileUploadController.java:84)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
  </code></pre>
  
  <p>The <em>hbm</em>:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;!-- Generated Sep 30, 2015 10:32:57 PM by Hibernate Tools 3.4.0.CR1 --&gt;
  &lt;hibernate-mapping&gt;
      &lt;class name="com.np.upload.pojo.NpUploads" table="np_document_uploads" dynamic-update="true"&gt;
          &lt;id name="docId" type="java.lang.Integer"&gt;
              &lt;column name="doc_id" /&gt;
              &lt;generator class="identity" /&gt;
          &lt;/id&gt;
          &lt;version name="version" type="java.lang.Integer"&gt;
              &lt;column name="version" /&gt;
          &lt;/version&gt;
          &lt;property name="moduleName" type="string"&gt;
              &lt;column name="module_name" not-null="true" /&gt;
          &lt;/property&gt;
          &lt;property name="mappingId" type="string"&gt;
              &lt;column name="mapping_id" not-null="true" /&gt;
          &lt;/property&gt;
          &lt;property name="docType" type="string"&gt;
              &lt;column name="doc_type" not-null="true" /&gt;
          &lt;/property&gt;
          &lt;property name="docName" type="string"&gt;
              &lt;column name="doc_name" not-null="true" /&gt;
          &lt;/property&gt;
          &lt;property name="docPath" type="string"&gt;
              &lt;column name="doc_path" length="1024" not-null="true" /&gt;
          &lt;/property&gt;
          &lt;property name="createdTime" type="timestamp" insert="false" update="false"&gt;
              &lt;column name="created_time" length="19" /&gt;
          &lt;/property&gt;
          &lt;property name="modifiedTime" type="timestamp" insert="false" update="false"&gt;
              &lt;column name="modified_time" length="19" /&gt;
          &lt;/property&gt;
      &lt;/class&gt;
      &lt;sql-query name="LAST_ADDED_DOC"&gt;
         &lt;![CDATA[SELECT d.* FROM np_document_uploads d
                  JOIN(
                      SELECT module_name, mapping_id, doc_type, max(version) AS version
                      FROM np_document_uploads u
                      WHERE u.module_name=:module and u.mapping_id=:mapping
                      GROUP BY module_name, mapping_id, doc_type
                  )tt USING( module_name, mapping_id, doc_type, version )
                  WHERE d.module_name=:module and d.mapping_id=:mapping]]&gt;
      &lt;/sql-query&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>and the <em>pojo</em>:</p>
  
  <pre><code>public class NpUploads
      implements java.io.Serializable
  {
      private static final long serialVersionUID = -5063169354511880324L;
      private Integer           docId;
      private Integer           version;
      private String            moduleName;
      private String            mappingId;
      private String            docType;
      private String            docName;
      private String            docPath;
      private Date              createdTime;
      private Date              modifiedTime;
  
      // getter and setters for all properties are there.
  }
  </code></pre>
  
  <p>Database schema:</p>
  
  <pre><code>+---------------+---------------+------+-----+-------------------+-----------------------------+
  | Field         | Type          | Null | Key | Default           | Extra                       |
  +---------------+---------------+------+-----+-------------------+-----------------------------+
  | doc_id        | int(11)       | NO   | PRI | NULL              | auto_increment              |
  | module_name   | varchar(255)  | NO   |     | NULL              |                             |
  | mapping_id    | varchar(255)  | NO   |     | NULL              |                             |
  | doc_type      | varchar(255)  | NO   |     | NULL              |                             |
  | doc_name      | varchar(255)  | NO   |     | NULL              |                             |
  | doc_path      | varchar(1024) | NO   |     | NULL              |                             |
  | version       | int(6)        | YES  |     | NULL              |                             |
  | created_time  | timestamp     | YES  |     | CURRENT_TIMESTAMP |                             |
  | modified_time | timestamp     | YES  |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
  +---------------+---------------+------+-----+-------------------+-----------------------------+
  </code></pre>