首页>代码>Java开发小工具(集合遍历导出等方法):针对任何项目文件夹,可以递归遍历文件夹中的任何后缀名的文件,提取其中的中文>/springboot-01-cache/src/main/java/com/atguigu/cache/config/MyCacheConfig.java
package com.atguigu.cache.config; import com.atguigu.cache.bean.Employee; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; import java.rmi.UnknownHostException; @Configuration public class MyCacheConfig { @Bean("mykeyGenerator") public RedisTemplate<Object, Employee> empRedisTemplate( RedisConnectionFactory redisConnectionFactory) throws UnknownHostException { RedisTemplate<Object, Employee> template = new RedisTemplate<Object, Employee>(); template.setConnectionFactory(redisConnectionFactory); Jackson2JsonRedisSerializer<Employee> ser = new Jackson2JsonRedisSerializer<Employee>(Employee.class); template.setDefaultSerializer(ser); return template; } }


SILKYYY
5月25日
暂无贡献等级
qis119
5月9日
暂无贡献等级
微信网友_6263159342649344 LV7
2022年12月16日
总有人间一两风 LV8
2022年12月10日
手捧阳光 LV6
2022年12月2日
Zeorwyc LV8
2022年4月22日
clcl55 LV1
2022年4月13日
crosa_Don LV18
2022年3月31日
zhang200hlo LV7
2022年2月14日
woaini12788 LV7
2022年1月18日