Criteria
Student student = (Student ) session.createCriteria(Student.class) .add(Restrictions.eq("classId", classId)).uniqueResult(); session.delete(student);HQL query:
String hql = "delete from Student where classId= :classId"; session.createQuery(hql).setString("classId", classId).executeUpdate();
0 comments:
Post a Comment