title: Spring/Hibernate Select Count(*) Query Customizing?
body: <p>Please help me,</p>
  
  <p>Here's my DAO that gave me correct number of rows but I want to add some conditions.</p>
  
  <pre><code>@Override
  public int getAllRows(SearchForm searchForm) {
      logger.info("SearchForm Detail :: " + searchForm);
      Session session = this.sessionFactory.getCurrentSession();
      Query query = (Query) session.createQuery(" select count(*) from EmployeeVO");
      int rows = ((Number) query.uniqueResult()).intValue();
      logger.info("Number of Rows :: " + rows);
      return rows;
  }
  </code></pre>
  
  <p>this is my MySQL Query :</p>
  
  <p>SELECT 
  first_name </p>
  
  <p>FROM 
  employees </p>
  
  <p>WHERE 
  first_name LIKE '%ab%' </p>
  
  <p>AND 
  salary > 0 and salary &lt; 100000;</p>