springboot+mybatis
文章平均质量分 67
倪默遥
不要假装让自己很努力
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
springboot + mybatis 使用 ehcache 缓存
我原本是学C/C++ 的,由于公司的需要,不得不转向java,发现 java 所要学的东西太多了,可是一嘴吃不成一个胖子,什么事情都是需要一步一步来,因此折腾了一下缓存,对缓存的配置文件似懂非懂,但是成功使用了缓存 在我折腾的过程中,真的好想有一个帖子能够指导我成功使用,但由于一些问题,让我对缓存某一些细节理解偏差,因此写这个博客暴露一下当初理解有偏差的细节,也希望得到更多大神的指点,原创 2018-01-21 16:05:20 · 5203 阅读 · 2 评论 -
mybatis的缓存机制(一级缓存二级缓存和刷新缓存)和mybatis整合ehcache
转载地址: http://www.360doc.com/content/15/1205/07/29475794_518018352.shtml1 查询缓存 1.1 什么是查询缓存mybatis提供查询缓存,用于减轻数据压力,提高数据库性能。mybaits提供一级缓存,和二级缓存。 一级缓存是SqlSession级别的缓存。在操作数转载 2018-01-21 18:51:43 · 837 阅读 · 0 评论 -
springboot+mybatis 搭建环境
Springboot + mybatis 环境搭建springBoot 就是讲一些基础的框架集合起来,提供默认的配置,减少人为的配置。不用 springBoot 而用spring 也是可以将项目搭建起来的。 开发环境: IDEA(推荐) 1:Intellij idea菜单栏File->new->project 2:选择左侧栏中spring initia原创 2018-01-07 15:33:27 · 8125 阅读 · 0 评论 -
SpringBoot + mybatis 分页查询
com.github.pagehelper.PageHelper是一款好用的开源免费的Mybatis第三方分页插件。使用的时候,只要简单配置,就可以在查询语句之后得到所需的分页信息。1:在 pom.xml 中引入依赖项。dependency> groupId>com.github.pagehelpergroupId> artifactId>pagehelperarti原创 2018-01-17 11:33:25 · 11420 阅读 · 0 评论 -
mybatis 模糊查询使用 like 的三种方法
1. 参数中直接加入%% param.setUsername("%CD%"); param.setPassword("%11%"); select id,sex,age,username,password from person where true AND username LIKE #{username} AND password LIKE原创 2018-02-01 13:54:36 · 519 阅读 · 0 评论 -
SpringBoot + Mybatis 的 insert 通过注解传入多个参数
直接上代码,希望对大家有帮助@Insert("insert into a_manu_model(manu_code,model_code) values(#{manuCode},#{modelCode})")void addManuModel(@Param("manuCode")String manuCode, @Param("modelCode") String modelCode);原创 2018-01-10 21:24:18 · 8272 阅读 · 1 评论 -
springboot 启动后执行特定的方法
在平时的开发中可能遇到这样的问题,在springboot 容器启动之后执行特定的方法或者类。数据库连接之类的。SpringBoot给我们提供了两个接口来帮助我们实现这种需求。这两个接口分别为CommandLineRunner和ApplicationRunner这两个接口中有一个run方法,我们只需要实现这个方法即可。这两个接口的不同之处在于:ApplicationRunner中run方法的参数为A...原创 2018-02-09 15:53:32 · 22145 阅读 · 2 评论 -
SpringBoot 复制 MultipartFile 类型的文件
在网上找了好多,也尝试了好多,最终发现,太他妈简单了吧?@PostMapping("uploadFile")public Object multipleSave(@RequestParam("file") MultipartFile file,@RequestParam("file2") MultipartFile file2) throws IOException{ logger.in...原创 2018-02-28 17:34:31 · 7500 阅读 · 2 评论 -
Tomcat 启动时 SecureRandom 非常慢解决办法
在springboot 项目之后,发现第一次用户登录时,需要好长时间或者要登录好多次才能登录成功。通过日志发现:2018-10-30 10:32:33.475 INFO 13825 --- [nio-8110-exec-3] o.a.c.util.SessionIdGeneratorBase :Creation of SecureRandom instance for session ID...原创 2018-10-30 16:59:25 · 1299 阅读 · 0 评论
分享