springMVC的请求方法中处理多个mybatis方法,到某个方法中断了:BindingException:has an unsupported return type

例如:
  1. @ResponseBody
  2. @RequestMapping(value = "toRequestDeleteDome", method = RequestMethod.POST)
  3. public ConverntReturnList deleteSomeHandler(@RequestParam("del_items[]") Integer[] array, @RequestParam("show_page") Integer curPageNum) {
  4. System.out.println(array.toString());
  5. productionDao.toDeleteYourSelction(array);
  6. PageHelper.startPage(curPageNum, 10);
  7. List<Production> list = productionDao.getAllProduction();
  8. int allResultPages = ((Page) list).getPages();
  9. int curResultPage = ((Page) list).getPageNum();
  10. return new ConverntReturnList(curResultPage, allResultPages, list);
  11. }
在运行productionDao.toDeleteYourSelction(array);之后,程序就死了,没有运行下去,报错如下:
mybatis的处理出错:
  1. org.apache.ibatis.binding.BindingException:
  2. Mapper method 'com.dao.ProductionMapper.toDeleteSelection' has an unsupported return type: class [Ljava.lang.Integer;


实际情况:
sql删除没有返回值:
  1. <!--根据选择删除-->
  2. <delete id="toDeleteSelection" parameterType="arraylist">
  3. DELETE FROM ssh_info WHERE ssh_info.ID IN
  4. <foreach collection="array" item="item" open="(" separator="," close=")">#{item}</foreach>
  5. </delete>
但在mapper的dao中却有返回值,这里出错了
  1. Integer[] toDeleteSelection(Integer[] arr);
应该改为:
  1. void toDeleteSelection(Integer[] arr);





原文地址:https://www.cnblogs.com/share2015/p/5372589.html