如果你写的代码是拷贝粘贴过来的那么我觉得que=sess.createQuery(hql3);que.setLong("param", apId);que=sess.createQuery(hql3);//这句是不必要的que.executeUpdate();