当前位置:网站首页>Redis insert data garbled solution
Redis insert data garbled solution
2022-07-06 20:39:00 【xiao pan】
1、key and value The statement
2、 New configuration class
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializer;
import javax.annotation.PostConstruct;
@Configuration
public class RedisUtils {
@Autowired
private RedisTemplate redisTemplate;
@PostConstruct
public void init() {
initRedisTemplate();
}
private void initRedisTemplate() {
RedisSerializer stringSerializer = redisTemplate.getStringSerializer();
redisTemplate.setKeySerializer(stringSerializer);
redisTemplate.setHashKeySerializer(stringSerializer);
redisTemplate.setValueSerializer(stringSerializer);
redisTemplate.setHashValueSerializer(stringSerializer);
}
}
3、 Perfect solution to garbled code
边栏推荐
- Common doubts about the introduction of APS by enterprises
- Rhcsa Road
- Unity makes AB package
- OAI 5G NR+USRP B210安装搭建
- Appx code signing Guide
- Tencent T4 architect, Android interview Foundation
- 2022 portal crane driver registration examination and portal crane driver examination materials
- Unity making plug-ins
- Continuous test (CT) practical experience sharing
- 自定义限流注解
猜你喜欢
看过很多教程,却依然写不好一个程序,怎么破?
Anaconda安裝後Jupyter launch 沒反應&網頁打開運行沒執行
OAI 5G NR+USRP B210安装搭建
OLED屏幕的使用
Detailed introduction of distributed pressure measurement system VIII: basic introduction of akka actor model
Build your own application based on Google's open source tensorflow object detection API video object recognition system (IV)
Value of APS application in food industry
Basic knowledge of lists
2022 construction electrician (special type of construction work) free test questions and construction electrician (special type of construction work) certificate examination
use. Net analysis Net talent challenge participation
随机推荐
棋盘左上角到右下角方案数(2)
【每周一坑】正整数分解质因数 +【解答】计算100以内质数之和
recyclerview gridlayout 平分中间空白区域
永磁同步电机转子位置估算专题 —— 基波模型类位置估算概要
Special topic of rotor position estimation of permanent magnet synchronous motor -- Summary of position estimation of fundamental wave model
SSO single sign on
Logic is a good thing
2022 portal crane driver registration examination and portal crane driver examination materials
强化学习-学习笔记5 | AlphaGo
【微信小程序】运行机制和更新机制
How to turn a multi digit number into a digital list
BUUCTF---Reverse---easyre
BeagleBoneBlack 上手记
I've seen many tutorials, but I still can't write a program well. How can I break it?
2022 nurse (primary) examination questions and new nurse (primary) examination questions
Initial experience of addresssanitizer Technology
Basic knowledge of lists
【DSP】【第一篇】开始DSP学习
知识图谱构建流程步骤详解
Implementation of packaging video into MP4 format and storing it in TF Card