org.springframework.datastore.redis.engine
Class RedisPropertyValueIndexer

java.lang.Object
  extended by org.springframework.datastore.redis.engine.RedisPropertyValueIndexer
All Implemented Interfaces:
PropertyValueIndexer<Long>

public class RedisPropertyValueIndexer
extends Object
implements PropertyValueIndexer<Long>

Indexes property values for querying later

Since:
1.0

Constructor Summary
RedisPropertyValueIndexer(MappingContext context, RedisEntityPersister redisEntityPersister, PersistentProperty property)
           
 
Method Summary
 String getIndexName(Object value)
           
 String getIndexPattern(String pattern)
           
 void index(Object value, Long primaryKey)
          Creates an index for the given value to the specified key
 List<Long> query(Object value)
          Queries the given value and returns the keys
 List<Long> query(Object value, int offset, int max)
          Queries the given value and returns the keys
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RedisPropertyValueIndexer

public RedisPropertyValueIndexer(MappingContext context,
                                 RedisEntityPersister redisEntityPersister,
                                 PersistentProperty property)
Method Detail

index

public void index(Object value,
                  Long primaryKey)
Description copied from interface: PropertyValueIndexer
Creates an index for the given value to the specified key

Specified by:
index in interface PropertyValueIndexer<Long>
Parameters:
value - The value
primaryKey - The key

query

public List<Long> query(Object value)
Description copied from interface: PropertyValueIndexer
Queries the given value and returns the keys

Specified by:
query in interface PropertyValueIndexer<Long>
Parameters:
value - The value to query by
Returns:
The primary keys

query

public List<Long> query(Object value,
                        int offset,
                        int max)
Description copied from interface: PropertyValueIndexer
Queries the given value and returns the keys

Specified by:
query in interface PropertyValueIndexer<Long>
Parameters:
value - The value to query by
offset - The offset position to start from
max - The maximum number of records
Returns:
The primary keys

getIndexName

public String getIndexName(Object value)
Specified by:
getIndexName in interface PropertyValueIndexer<Long>
Parameters:
value - The indexed value
Returns:
The name of the index

getIndexPattern

public String getIndexPattern(String pattern)