Class MappingRedisConverter

java.lang.Object
org.springframework.data.redis.core.convert.MappingRedisConverter
All Implemented Interfaces:
InitializingBean, EntityConverter<RedisPersistentEntity<?>,RedisPersistentProperty,Object,RedisData>, EntityReader<Object,RedisData>, EntityWriter<Object,RedisData>, RedisConverter

public class MappingRedisConverter extends Object implements RedisConverter, InitializingBean
RedisConverter implementation creating flat binary map structure out of a given domain type. Considers Indexed annotation for enabling helper structures for finder operations.

NOTE MappingRedisConverter is an InitializingBean and requires afterPropertiesSet() to be called.
 
 @RedisHash("persons")
 class Person {

   @Id String id;
   String firstname;

   List<String> nicknames;
   List<Person> coworkers;

   Address address;
   @Reference Country nationality;
 }
 
 
The above is represented as:
 
 _class=org.example.Person
 id=1
 firstname=rand
 lastname=al'thor
 coworkers.[0].firstname=mat
 coworkers.[0].nicknames.[0]=prince of the ravens
 coworkers.[1].firstname=perrin
 coworkers.[1].address.city=two rivers
 nationality=nationality:andora
 
 
Since:
1.7
Author:
Christoph Strobl, Greg Turnquist, Mark Paluch, Golam Mazid Sajib