Hibernate HQL delete with and
问题 Hibernate doesn't delete my row: public boolean deleteVote(Login user, int pid){ Session session = getSession(); try{ String hql = "delete from Vote where uid= :uid AND pid= :pid"; Query query = session.createQuery(hql); System.out.println(user.getUid() + " and pid: " + pid); query.setString("uid", user.getUid()); query.setInteger("pid", pid); System.out.println(query.executeUpdate()); }catch(Exception e){ Outprint: uid: 123 and pid: 1 Hibernate: delete from votes where uid=? and pid=? 1 The