title: How to use Delete query in Hibernate
body: <p>I'm using <code>Hibernate</code> to delete the records from a table,but this giving an exception, could anyone know how to overcome this problem in the below query?</p>
  
  <pre><code> Session ses = HibernateUtil.getSessionFactory().openSession();
          Transaction tx = ses.beginTransaction();
          Query q = ses.createQuery("from RegisterPojo  where email =:email");
          q.setParameter("email", sl_no);
          RegisterPojo pojo = (RegisterPojo) q.list().get(0);
          ses.delete(pojo);
          tx.commit();
          ses.close();
  </code></pre>