title: Retrieve single field rather than whole pojo in hibernate
body: <p>I have some query regarding hibernate,</p>
  
  <p>Table : Employee_Master</p>
  
  <p>Id      Number
  Name    Varchar
  Salary  long</p>
  
  <p>POJO: EmployeeMaster.java</p>
  
  <pre><code>public class EmployeeMaster {
  
  private int id ;
  private String name;
  private long salary;
  
  //... all field s getter/ setter  methods
  
  
  }
  </code></pre>
  
  <p>Now I want to get only name from such id.</p>
  
  <p>SQL query like like: </p>
  
  <pre><code>select name from employee_master where id = 10;
  </code></pre>
  
  <p>But how can we achieve in hibernate the above same thing?</p>
  
  <pre><code>session.createQuery("from EmployeeMaster empMaster where empMaster.id = 10");
  </code></pre>
  
  <p>This solution I know but it will return whole pojo list.
  But I want only that field name so what should I do ?</p>