For deleting use HQL which is the best option, I think, Criteria’s main purpose is for only retrieving the data.
This one is with Criteria
Student student = (Student ) session.createCriteria(Student.class)
.add(Restrictions.eq("classId", classId)).uniqueResult();
session.delete(student);
And this one is simple HQL query:
String hql = "delete from Student where classId= :classId";
session.createQuery(hql).setString("classId", classId).executeUpdate();