Class RedisKeyValueAdapter

java.lang.Object
org.springframework.data.keyvalue.core.AbstractKeyValueAdapter
org.springframework.data.redis.core.RedisKeyValueAdapter
All Implemented Interfaces:
EventListener, Aware, DisposableBean, InitializingBean, ApplicationContextAware, ApplicationListener<RedisKeyspaceEvent>, KeyValueAdapter

Redis specific KeyValueAdapter implementation. Uses binary codec to read/write data from/to Redis. Objects are stored in a Redis Hash using the value of RedisHash, the KeyspaceConfiguration or just Class.getName() as a prefix.
Example
 
 @RedisHash("persons")
 class Person {
   @Id String id;
   String name;
 }


         prefix              ID
           |                 |
           V                 V
 hgetall persons:5d67b7e1-8640-4475-beeb-c666fab4c0e5
 1) id
 2) 5d67b7e1-8640-4475-beeb-c666fab4c0e5
 3) name
 4) Rand al'Thor
 
 

The KeyValueAdapter is not intended to store simple types such as String values. Please use RedisTemplate for this purpose.
Since:
1.7
Author:
Christoph Strobl, Mark Paluch, Andrey Muchnik, John Blum