@ResponseBody
@RequestMapping(value = "toRequestDeleteDome", method = RequestMethod.POST)
public ConverntReturnList deleteSomeHandler(@RequestParam("del_items[]") Integer[] array, @RequestParam("show_page") Integer curPageNum) {
System.out.println(array.toString());
productionDao.toDeleteYourSelction(array);
PageHelper.startPage(curPageNum, 10);
List<Production> list = productionDao.getAllProduction();
int allResultPages = ((Page) list).getPages();
int curResultPage = ((Page) list).getPageNum();
return new ConverntReturnList(curResultPage, allResultPages, list);
}
在运行productionDao.toDeleteYourSelction(array);之后,程序就死了,没有运行下去,报错如下:
mybatis的处理出错:
org.apache.ibatis.binding.BindingException:
Mapper method 'com.dao.ProductionMapper.toDeleteSelection' has an unsupported return type: class [Ljava.lang.Integer;
实际情况:
sql删除没有返回值:
<!--根据选择删除-->
<delete id="toDeleteSelection" parameterType="arraylist">
DELETE FROM ssh_info WHERE ssh_info.ID IN
<foreach collection="array" item="item" open="(" separator="," close=")">#{item}</foreach>
</delete>
但在mapper的dao中却有返回值,这里出错了
Integer[] toDeleteSelection(Integer[] arr);
应该改为:
void toDeleteSelection(Integer[] arr);