title: Hibernate native query return integer list not working
body: <p>I am using native query in hibernate and it will return me list of id. I want to convert this list in to integer list. But it is not working and showing me the exception.  </p>
  
  <pre><code>public List&lt;Integer&gt; fethcSurvayIdOnCount(){
              HibernateCallback action = new HibernateCallback() {
              public Object doInHibernate(Session session)
              throws HibernateException, SQLException {
          String hq = "select id from tb_abc where age='10'" ;
  
          SQLQuery query = (SQLQuery) session
                  .createSQLQuery(hq)
                  .setResultTransformer(
                          Transformers
                                  .aliasToBean(Integer.class));
  
          return query.list();
      }
      };
      return (List&lt;Integer&gt;) getHibernateTemplate()
          .execute(action);
      }   
  </code></pre>
  
  <p>Here  is the exception</p>
  
  <pre><code>org.springframework.orm.hibernate3.HibernateSystemException: Could not find setter for id on class java.lang.Integer; nested exception is org.hibernate.PropertyNotFoundException: Could not find setter for id on class java.lang.Integer
      at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:676)
      at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
      at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
      at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339) 
  </code></pre>