I have very common requirement and surprised that not able to find the same after browsing lot of pages over the internet.
Below is the code:
@Cacheable(value = "cache", key = "#request.userId", cacheManager = "defaultCacheManager")
public UserDto createOrFetch(CreateUserRequest request) {
I want to store, returned UserDto object as Redis Hash, but by default it storing it as simple key value pair.
I know this can achieved via HashOperations which we can get from Redis Template but it lacks to set ttl values to hashes.
Also RedisRepository can also be used by adding @RedisHash on class definition.
Just wondering is it possible to acheive same via @Cacheable annotaion way. Note: I am using Jedis client with SpringBoot 2.1.4.RELEASE