Redis - How to configure custom conversions

前端 未结 4 1278
温柔的废话
温柔的废话 2021-01-17 19:30

In spring-data-redis, How do we need configure custom converters that can be auto-wired/injected from Spring boot application or configuration.

I read about @R

4条回答
  •  天涯浪人
    2021-01-17 20:11

    You have to declare CustomConversions bean named "redisCustomConversions" in your application configuration.

    @Bean
    public CustomConversions redisCustomConversions(){
        return new CustomConversions(Arrays.asList(new YourWritingConverter(), new YourReadingConverter()));
    }
    

提交回复
热议问题