我Hibernate
用来从表中删除记录,但这给出了一个例外,谁能知道如何在下面的查询中克服这个问题?
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();