Class RedisEnhancedKeyValueAdapter

java.lang.Object
org.springframework.data.keyvalue.core.AbstractKeyValueAdapter
org.springframework.data.redis.core.RedisKeyValueAdapter
com.redis.om.spring.RedisEnhancedKeyValueAdapter
All Implemented Interfaces:
EventListener, org.springframework.beans.factory.Aware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.data.redis.core.RedisKeyspaceEvent>, org.springframework.data.keyvalue.core.KeyValueAdapter

public class RedisEnhancedKeyValueAdapter extends org.springframework.data.redis.core.RedisKeyValueAdapter
  • Constructor Details

    • RedisEnhancedKeyValueAdapter

      public RedisEnhancedKeyValueAdapter(org.springframework.data.redis.core.RedisOperations<?,?> redisOps, RedisModulesOperations<?> rmo, RediSearchIndexer indexer, FeatureExtractor featureExtractor, RedisOMSpringProperties redisOMSpringProperties)
      Creates new RedisKeyValueAdapter with default RedisMappingContext and default RedisCustomConversions.
      Parameters:
      redisOps - must not be null.
      rmo - must not be null.
      indexer - must not be null.
    • RedisEnhancedKeyValueAdapter

      public RedisEnhancedKeyValueAdapter(org.springframework.data.redis.core.RedisOperations<?,?> redisOps, RedisModulesOperations<?> rmo, org.springframework.data.redis.core.mapping.RedisMappingContext mappingContext, RediSearchIndexer indexer, FeatureExtractor featureExtractor, RedisOMSpringProperties redisOMSpringProperties)
      Creates new RedisKeyValueAdapter with default RedisCustomConversions.
      Parameters:
      redisOps - must not be null.
      rmo - must not be null.
      mappingContext - must not be null.
      indexer - must not be null.
    • RedisEnhancedKeyValueAdapter

      public RedisEnhancedKeyValueAdapter(org.springframework.data.redis.core.RedisOperations<?,?> redisOps, RedisModulesOperations<?> rmo, org.springframework.data.redis.core.mapping.RedisMappingContext mappingContext, @Nullable org.springframework.data.convert.CustomConversions customConversions, RediSearchIndexer indexer, FeatureExtractor featureExtractor, RedisOMSpringProperties redisOMSpringProperties)
      Creates new RedisKeyValueAdapter.
      Parameters:
      redisOps - must not be null.
      rmo - must not be null.
      mappingContext - must not be null.
      customConversions - can be null.
      indexer - must not be null.
  • Method Details

    • put

      public Object put(Object id, Object item, String keyspace)
      Specified by:
      put in interface org.springframework.data.keyvalue.core.KeyValueAdapter
      Overrides:
      put in class org.springframework.data.redis.core.RedisKeyValueAdapter
    • get

      @Nullable public <T> T get(Object id, String keyspace, Class<T> type)
      Specified by:
      get in interface org.springframework.data.keyvalue.core.KeyValueAdapter
      Overrides:
      get in class org.springframework.data.redis.core.RedisKeyValueAdapter
    • delete

      public <T> T delete(Object id, String keyspace, Class<T> type)
      Specified by:
      delete in interface org.springframework.data.keyvalue.core.KeyValueAdapter
      Overrides:
      delete in class org.springframework.data.redis.core.RedisKeyValueAdapter
    • deleteAllOf

      public void deleteAllOf(String keyspace)
      Specified by:
      deleteAllOf in interface org.springframework.data.keyvalue.core.KeyValueAdapter
      Overrides:
      deleteAllOf in class org.springframework.data.redis.core.RedisKeyValueAdapter
    • getAllIds

      public <T> List<String> getAllIds(String keyspace, Class<T> type)
    • getAllOf

      public <T> List<T> getAllOf(String keyspace, Class<T> type, long offset, int rows)
      Get all elements for given keyspace.
      Overrides:
      getAllOf in class org.springframework.data.redis.core.RedisKeyValueAdapter
      Type Parameters:
      T - the target type
      Parameters:
      keyspace - the keyspace to fetch entities from.
      type - the desired target type.
      offset - index value to start reading.
      rows - maximum number of entities to return.
      Returns:
      never null.
      Since:
      2.5
    • update

      public void update(org.springframework.data.redis.core.PartialUpdate<?> update)
      Overrides:
      update in class org.springframework.data.redis.core.RedisKeyValueAdapter
    • count

      public long count(String keyspace)
      Specified by:
      count in interface org.springframework.data.keyvalue.core.KeyValueAdapter
      Overrides:
      count in class org.springframework.data.redis.core.RedisKeyValueAdapter
    • contains

      public boolean contains(Object id, String keyspace)
      Specified by:
      contains in interface org.springframework.data.keyvalue.core.KeyValueAdapter
      Overrides:
      contains in class org.springframework.data.redis.core.RedisKeyValueAdapter
    • getKey

      protected String getKey(String keyspace, Object id)