title: hibernate java select queries
body: <p>i am new to this and today i tried to play hibernate with a method that returns the result of selected  row...if is selected then it can return the result in int.. here is my method</p>
  
  <pre><code> public int validateSub(String slave, String source, String table){
      Session session = HibernateUtil.getSessionFactory().openSession();
      session.beginTransaction();
  
  
      Query q = session.createQuery("from Subscribers where slave = :slave AND source = :source AND tbl = :tbl");
      q.setParameter("slave", slave);
      q.setParameter("source", source);
      q.setParameter("tbl", table);
  
      int result = q.executeUpdate();
  
      return result;
  
  }
  </code></pre>
  
  <p>from this method i tried to validate the 3 values that i get from the Subscribers table but at the end i tried to compile having this error</p>
  
  <pre><code>     Exception in thread "Thread-0" org.hibernate.hql.QueryExecutionRequestException: Not supported for select queries [from com.datadistributor.main.Subscribers where slave = :slave AND source = :source AND tbl = :tbl]
  </code></pre>