<pre name="code" class="java">public String del() {
String[] ids = getRequest().getParameterValues("ids");
if (ids != null) {
for (String id : ids) {
Section section = sectionService.get(new Long(id));
if(null != section){
delse(section);
}
}
}
jsonString = "{success:true}";
return SUCCESS;
}
private void delse(Section section){
Set<Section> sets=section.getSections();
if(sets.size()>0){
for (Section section2 : sets) {
delse(section2);
}
sectionService.remove(section);
}else{
sectionService.remove(section);
}
}
级联删除栏目
最新推荐文章于 2022-07-08 13:36:38 发布