Page<User> page = new Page<>(); User user = new User(); user.setAge(20); user.setId(1); System.out.println(JSON.toJSONString(user)); page.add(user); page.setPageNum(2); page.setPageSize(20);
解决mybatis foreach 错误: Parameter '__frch_item_0' not found 在遍历对象的属性(是ArrayList对象)时报错: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter '__frch_item_0' not found. Available parameters
批量删除: <delete id= "deleteBatchByXXX" parameterType= "list"> delete from 表名 where groupon_id in <foreach collection="list" item= "item" index ="index" open= "(" close =")" separ
先来看一段代码,摘自阿里巴巴的java开发手册 List<String> a = new ArrayList<String>(); a.add("1"); a.add("2"); for (String temp : a) { if("1".equals(temp)){ a.remove(temp); } } 此时执行代码,没有问题,但是需要注意,循环此时只执行了一次.具体过程后面去分析.再来看一段会出问题的代码: Lis