springBoot整合Spring-Data-JPA, Redis Redis-Desktop-Manager2020 windows
Posted 雨听风说
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了springBoot整合Spring-Data-JPA, Redis Redis-Desktop-Manager2020 windows相关的知识,希望对你有一定的参考价值。
源码地址:https://gitee.com/ytfs-dtx/SpringBoot
Redis-Desktop-Manager2020地址:
https://ytsf.lanzous.com/b01bei1bc
密码:2qan
集成Spring Data JPA
添加Spring Data JPA的起步依赖
添加数据库驱动依赖
在application.yml中配置数据库和JPA的相关属性
创建实体配置实体
编写测试类
控制台打印信息
集成Redis--为了测试方便使用windows版的Redis
添加Redis起步依赖
启动redis服务器
配置Redis连接信息
注入RedisTemplate测试redis
第一次执行
从数据库中获取数据
第二次执行
从redis中获取数据
打开redis可视化工具(redis desktop manager),发现键值已存在
以上是关于springBoot整合Spring-Data-JPA, Redis Redis-Desktop-Manager2020 windows的主要内容,如果未能解决你的问题,请参考以下文章
[SpringBoot系列]SpringBoot如何整合SSMP
SpringBoot完成SSM整合之SpringBoot整合junit