org.springframework.datastore.engine
Interface PropertyValueIndexer<K>

All Known Implementing Classes:
RedisPropertyValueIndexer

public interface PropertyValueIndexer<K>

Responsible for creating indices for property values used in queries This interface is designed for usage in datastores that don't automatically create indices and require the application to create the indices manually

Since:
1.0

Method Summary
 String getIndexName(Object value)
           
 void index(Object value, K primaryKey)
          Creates an index for the given value to the specified key
 List<K> query(Object value)
          Queries the given value and returns the keys
 List<K> query(Object value, int offset, int max)
          Queries the given value and returns the keys
 

Method Detail

index

void index(Object value,
           K primaryKey)
Creates an index for the given value to the specified key

Parameters:
value - The value
primaryKey - The key

query

List<K> query(Object value)
Queries the given value and returns the keys

Parameters:
value - The value to query by
Returns:
The primary keys

query

List<K> query(Object value,
              int offset,
              int max)
Queries the given value and returns the keys

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

String getIndexName(Object value)
Parameters:
value - The indexed value
Returns:
The name of the index