最代码官方
2020-10-24 11:43:47
原证精
Spring Cache标注实现对Redis缓存数据的增删改查的简单实例
项目描述
Spring Cache框架内置了如下标注
@Cacheable 查询
@CachePut 新增
@CacheEvict 失效
来实现对Service层方法的redis支持
运行环境
jdk8+redis+mysql+IntelliJ IDEA+maven
项目技术(必填)
spring+spring mvc+spring data jpa+spring data redis+spring junit
数据库文件(可选)
启动springboot容器是自建
依赖包文件(可选)
maven搭建
链接:https://pan.baidu.com/s/1l5OgVsmnSIT7gotw65O7hg
提取码:q6uw
项目截图(必填)
运行截图(必填)
在test目录下执行findAll test方法会把数据缓存到redis中
redis manager查询
数据库记录
执行findById方法会把id=2的数据缓存到redis中
执行delete的junit方法会删除redis和mysql
注意事项(可选)
通过junit测试,也可以通过postman测试
新建
http://localhost:8080//api/v1/products
查询
http://localhost:8080//api/v1/products/1
猜你喜欢
- Redis海量数据java测试代码
- Spring MVC+Freemarker+Bootstrap整合实现spring-data-redis增删改查的入门学习实例
- SpringBoot通过Redis的Geo获取当前位置方圆一公里的业务代理点
- redis-cli pipe方式导入mysql sql查询导出的redis Protocol格式数据
- 基于mysql binlog的redis/elasticsearch数据同步中间件
- ssm使用redis做为spring+spring MVC+mybatis整合的二级缓存
- ssm使用redis做为spring+spring MVC+mybatis整合的二级缓存,基于maven搭建
- 采用Keepalived实现Redis双机高可用
- java web网页版redis客户端工具
- iptables禁止外网访问redis server服务默认端口6379的命令
- spring boot+redis实现共享java servlet session对象
- redis+nodejs的数据获取
请下载代码后再发表评论
文件名:springboot-caching-redis.zip,文件大小:10.21K
下载
- /
- /springboot-caching-redis
- /springboot-caching-redis/pom.xml
- /springboot-caching-redis/src
- /springboot-caching-redis/src/main
- /springboot-caching-redis/src/main/java
- /springboot-caching-redis/src/main/java/com
- /springboot-caching-redis/src/main/java/com/hellokoding
- /springboot-caching-redis/src/main/java/com/hellokoding/springboot
- /springboot-caching-redis/src/main/java/com/hellokoding/springboot/caching
/springboot-caching-redis/src/main/java/com/hellokoding/springboot/caching/Application.java
- /springboot-caching-redis/src/main/java/com/hellokoding/springboot/caching/configuration
/springboot-caching-redis/src/main/java/com/hellokoding/springboot/caching/configuration/CachingConfiguration.java
/springboot-caching-redis/src/main/java/com/hellokoding/springboot/caching/configuration/CustomCacheErrorHandler.java
/springboot-caching-redis/src/main/java/com/hellokoding/springboot/caching/configuration/CustomKeyGenerator.java
- /springboot-caching-redis/src/main/java/com/hellokoding/springboot/caching/product
- /springboot-caching-redis/src/main/java/com/hellokoding/springboot/caching
- /springboot-caching-redis/src/main/java/com/hellokoding/springboot
- /springboot-caching-redis/src/main/java/com/hellokoding
- /springboot-caching-redis/src/main/java/com
- /springboot-caching-redis/src/main/java
- /springboot-caching-redis/src/main
- /springboot-caching-redis

- Redis海量数据java测试代码
- 原证精 Spring MVC+Freemarker+Bootstrap整合实现spring-data-redis增删改查的入门学习实例
- 证 SpringBoot通过Redis的Geo获取当前位置方圆一公里的业务代理点
- 原证精 redis-cli pipe方式导入mysql sql查询导出的redis Protocol格式数据
- 原 基于mysql binlog的redis/elasticsearch数据同步中间件
- 原精 ssm使用redis做为spring+spring MVC+mybatis整合的二级缓存
- 原精 ssm使用redis做为spring+spring MVC+mybatis整合的二级缓存,基于maven搭建
- 采用Keepalived实现Redis双机高可用
- 精 java web网页版redis客户端工具
- 原证 iptables禁止外网访问redis server服务默认端口6379的命令
- 原证 spring boot+redis实现共享java servlet session对象
- 原 redis+nodejs的数据获取

十月* LV1
2022年9月22日
yinyun1985 LV14
2022年6月14日
zhenghongixin4065 LV9
2022年4月3日
breakCY LV15
2022年3月21日
xgjdmy_ccb LV11
2021年11月18日
阿昌先生 LV13
2021年6月28日
最代码官方 LV168
2020年12月18日
杰桑awa LV6
2020年10月30日
a1453370401 LV10
2020年10月25日
sweetlove LV20
2020年10月24日

sureivv LV2
1月9日
yyh1252 LV8
2024年10月23日
flygrass LV12
2024年3月28日
内心向阳 LV4
2023年11月8日
四季镇 LV9
2023年10月11日
644106 LV8
2023年6月8日
胡明杨
2023年5月29日
暂无贡献等级
youwuzuichen LV11
2023年3月27日
2237851964 LV1
2023年3月12日
banerwu LV3
2023年1月3日