求解hibernate中多对多关系中怎样删除他们关联的中间表数据?满地打滚求助!路过的帮帮忙呀O(∩_∩)O谢!! 20
Sessionsession=super.getSession();AdminadminTest=(Admin)session.get("com.crm.pojo.Adm...
Session session=super.getSession();
Admin adminTest=(Admin) session.get("com.crm.pojo.Admin", admin.getAid());
Employee employeeTest=(Employee) session.get("com.crm.pojo.Employee", employee.getEid());
System.out.println("admin.getemps().remove(employee)的移除情况:"+adminTest.getEmps().remove(employeeTest));
System.out.println("employee.getPrivs().remove(admin)的移除情况:"+employeeTest.getPrivs().remove(adminTest));
上述方法中为什么hibernate就是不发送下面的delete语句
“Hibernate: delete from t_admin_detail where aid=?” 展开
Admin adminTest=(Admin) session.get("com.crm.pojo.Admin", admin.getAid());
Employee employeeTest=(Employee) session.get("com.crm.pojo.Employee", employee.getEid());
System.out.println("admin.getemps().remove(employee)的移除情况:"+adminTest.getEmps().remove(employeeTest));
System.out.println("employee.getPrivs().remove(admin)的移除情况:"+employeeTest.getPrivs().remove(adminTest));
上述方法中为什么hibernate就是不发送下面的delete语句
“Hibernate: delete from t_admin_detail where aid=?” 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询