title: Column Alias in hibernate?
body: <p>I have table with following table schema :</p>
  
  <p><img src="https://i.stack.imgur.com/eUgch.png" alt="enter image description here">
  <br />
  I have created a method that returns the list of value on query execution.</p>
  
  <pre><code>    protected List findAllWithGroupClause(Class clazz) {
  
      List objects = null;
      try {
          startOperation();
          String SQL_QUERY = "SELECT COUNT(serviceName) AS RunningInstances ,serviceName,SUM(numberofthread) as workerThread "
                  + "FROM servicemanagerdetails WHERE servicemanagerstatus=:status GROUP BY serviceName";
          Query query = session.createQuery(SQL_QUERY);
          query.setString("status", "Running");
          objects = query.list();
          tx.commit();
      } catch (HibernateException e) {
          handleException(e);
      } finally {
          HibernateFactory.close(session);
      }
      return objects;
  }
  </code></pre>
  
  <p>and for that declared ServiceManagerDetails.hbm.xml file:</p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;hibernate-mapping&gt;
    &lt;class name="com.arosys.hibernatedatamanager.ServiceManagerDetails" table="servicemanagerdetails"&gt;
      &lt;id column="servicedetailsid" name="servicedetailsID" type="integer"&gt;
        &lt;generator class="increment"/&gt;
      &lt;/id&gt;
      &lt;property column="serviceID" name="servicemanagerID" type="string"/&gt;
      &lt;property column="servicemode" name="servicemode" type="string"/&gt;
      &lt;property column="servicetype" name="servicetype" type="string"/&gt;
      &lt;property column="servicemanagerstatus" name="servicemanagerstatus" type="string"/&gt;
      &lt;property column="controlqueue" name="controlQueue" type="string"/&gt;
      &lt;property column="controlexchange" name="contolExchange" type="string"/&gt;
      &lt;property column="controlroutingkey" name="controlRoutingkey" type="string"/&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>i have created column alias for that  it is necessary to write setter and getter method as well as define mapping?please explain how can retrieve value from list.</p>
  
  <p>Thanks</p>