编程语言
首页 > 编程语言> > Java SSH

Java SSH

作者:互联网

查找实体,并循环子集记录。

try {
            String pigeonholeId=request.getParameter("pigeonholeId");
            Pigeonhole p=pigeonholeService.get(pigeonholeId);
            p.setIsDelete(0);
            p.setDeleteReason(null);
            p.setDeleteTime(null);
            p.setDeletePerson(null);
            pigeonholeService.update(p);
            //将借阅记录中的删除记录清除
            String hql=" from Borrow where pigeonholeId=?";
            List<Borrow> borrowList=borrowService.findByHql(hql, new Object[]{pigeonholeId});
            if(borrowList != null && borrowList.size()>0){
                for(Borrow b:borrowList){
                    b.setIsRead(0);
                    borrowService.update(b);
                }
            }
        } catch (Exception e) {
            logger.error("异常_",e);
        }

 

标签:Java,String,pigeonholeId,hql,SSH,null,borrowService,borrowList
来源: https://www.cnblogs.com/axu92312/p/15736252.html