Class RedisJSONKeyValueAdapter

java.lang.Object
org.springframework.data.keyvalue.core.AbstractKeyValueAdapter
org.springframework.data.redis.core.RedisKeyValueAdapter
com.redis.om.spring.RedisJSONKeyValueAdapter
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 RedisJSONKeyValueAdapter extends org.springframework.data.redis.core.RedisKeyValueAdapter
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.data.redis.core.RedisKeyValueAdapter

    org.springframework.data.redis.core.RedisKeyValueAdapter.EnableKeyspaceEvents, org.springframework.data.redis.core.RedisKeyValueAdapter.ShadowCopy
  • Constructor Summary

    Constructors
    Constructor
    Description
    RedisJSONKeyValueAdapter(org.springframework.data.redis.core.RedisOperations<?,?> redisOps, RedisModulesOperations<?> rmo, org.springframework.data.redis.core.mapping.RedisMappingContext mappingContext, RediSearchIndexer indexer, com.google.gson.GsonBuilder gsonBuilder, Embedder embedder, RedisOMProperties redisOMProperties)
    Creates new RedisKeyValueAdapter with default RedisCustomConversions.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(Object id, String keyspace)
     
    long
    count(String keyspace)
     
     
    <T> T
    delete(Object id, String keyspace, Class<T> type)
     
    void
    deleteAllOf(String keyspace)
     
    <T> T
    get(Object id, String keyspace, Class<T> type)
     
    <T> T
    get(String key, Class<T> type)
     
    <T> List<String>
    getAllKeys(String keyspace, Class<T> type)
     
    <T> List<T>
    getAllOf(String keyspace, Class<T> type, long offset, int rows)
    Get all elements for given keyspace.
    put(Object id, Object item, String keyspace)
     

    Methods inherited from class org.springframework.data.redis.core.RedisKeyValueAdapter

    afterPropertiesSet, clear, createKey, delete, destroy, entries, execute, get, getAllOf, getAllOf, getConverter, onApplicationEvent, setApplicationContext, setEnableKeyspaceEvents, setKeyspaceNotificationsConfigParameter, setMessageListenerContainer, setShadowCopy, toBytes, update

    Methods inherited from class org.springframework.data.keyvalue.core.AbstractKeyValueAdapter

    count, find, find, getQueryEngine

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.context.ApplicationListener

    supportsAsyncExecution

    Methods inherited from interface org.springframework.data.keyvalue.core.KeyValueAdapter

    entries, exists
  • Constructor Details

    • RedisJSONKeyValueAdapter

      public RedisJSONKeyValueAdapter(org.springframework.data.redis.core.RedisOperations<?,?> redisOps, RedisModulesOperations<?> rmo, org.springframework.data.redis.core.mapping.RedisMappingContext mappingContext, RediSearchIndexer indexer, com.google.gson.GsonBuilder gsonBuilder, Embedder embedder, RedisOMProperties redisOMProperties)
      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.
  • 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
    • get

      @Nullable public <T> T get(String key, 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
      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.
    • getAllKeys

      public <T> List<String> getAllKeys(String keyspace, Class<T> type)
    • 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
    • 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
    • createKeyAsString

      public String createKeyAsString(String keyspace, Object id)