mybatis批量增加返回id值

来源:互联网 发布:spss modeler mac下载 编辑:程序博客网 时间:2024/05/20 05:04

1.mybatis官网简介,是支持返回批量增加的id值的

但是是在mybatis.3.3.1.jar这个版本才有

   mybatis3.3.1.jar下载地址:http://url.cn/56qreBw 密码123456

2.使用步骤

  2.1 mybatis xml写法

useGeneratedKeys="true"    keyProperty="id"
这两个必须的写  keyProperty的id值对应实体类

parameterType的类型必须是List



   2.2 service写法


  这里必须返回传递到xml文件里面的list,他会封装到这个里面

  2.3 controller

    

通过list,就可以使用返回的自增的id值做处理了


参考地址:

http://blog.csdn.net/jiangeeq/article/details/55047116

原创粉丝点击