JAVA怎么批量删除问题 150
publicStringdelete(){this.update_ID=(String)this.sessionMap.get("update_ID");if(this....
public String delete(){
this.update_ID = (String)this.sessionMap.get("update_ID");
if(this.update_ID.isEmpty()){
return "basketball";
}
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
try {
ResultTable2 resultTable2 = (ResultTable2)session.load(ResultTable2.class, update_ID);
session.delete(resultTable2);
} catch (HibernateException e) {
e.printStackTrace();
session.getTransaction().rollback();
}
session.getTransaction().commit();
return "basketball";
} 展开
this.update_ID = (String)this.sessionMap.get("update_ID");
if(this.update_ID.isEmpty()){
return "basketball";
}
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
try {
ResultTable2 resultTable2 = (ResultTable2)session.load(ResultTable2.class, update_ID);
session.delete(resultTable2);
} catch (HibernateException e) {
e.printStackTrace();
session.getTransaction().rollback();
}
session.getTransaction().commit();
return "basketball";
} 展开
12个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询