![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mybatis
闲忧
这个作者很懒,什么都没留下…
展开
-
mybatis单独使用时批量mappers
一般情况下,mybatis都是与spring配合使用,我们使用类似mapper-locations=classpath:mapper/**/*Mapper.xml全局配置映射的xml文件。但当mybatis单独使用时,并没有mybatis-spring包中提供扫描*.xml工具,只能通过mapper中package最大程度满足需求,以下为使用方式(默认为maven或者gradle项目架构约定): ...原创 2018-05-02 14:54:13 · 790 阅读 · 0 评论 -
mybatis 批量入库 参数list+pojo
mybatis批量入库,如果参数是List,没什么好说,但有时参数是一个list+pojo,要批量插入list的值,同时还要用到pojo中某些属性,以下为几种写法: 参数是数组 String[] 和 String//javaMap<String, Object> params = new HashMap<>(); params.put("userId",...原创 2018-05-02 15:32:07 · 1081 阅读 · 0 评论