I am using Spring Redis support to save my objects in Redis.
I have several DAOs which handle different Model classes:
For example, ShopperHistoryDao>
ShopperHistoryDao>
A bit of old thread, but you can do something like this:
Then in your Java class
@Autowire private RedisTemplate redisTemplate; public void save(Model model) { ObjectMapper obmap = new ObjectMapper(); redisTemplate.opsForHash().putAll(mode.getId(), obmap.convertValue(model, Map.class)); }