Class SimpleRedisDocumentRepository<T,ID>

java.lang.Object
org.springframework.data.keyvalue.repository.support.SimpleKeyValueRepository<T,ID>
com.redis.om.spring.repository.support.SimpleRedisDocumentRepository<T,ID>
All Implemented Interfaces:
RedisDocumentRepository<T,ID>, org.springframework.data.keyvalue.repository.KeyValueRepository<T,ID>, org.springframework.data.repository.CrudRepository<T,ID>, org.springframework.data.repository.ListCrudRepository<T,ID>, org.springframework.data.repository.ListPagingAndSortingRepository<T,ID>, org.springframework.data.repository.PagingAndSortingRepository<T,ID>, org.springframework.data.repository.query.QueryByExampleExecutor<T>, org.springframework.data.repository.Repository<T,ID>

public class SimpleRedisDocumentRepository<T,ID> extends org.springframework.data.keyvalue.repository.support.SimpleKeyValueRepository<T,ID> implements RedisDocumentRepository<T,ID>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final RediSearchIndexer
     
    protected final MappingRedisOMConverter
     
    protected final org.springframework.data.repository.core.EntityInformation<T,ID>
     
     
    protected final org.springframework.data.keyvalue.core.KeyValueOperations
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SimpleRedisDocumentRepository(org.springframework.data.repository.core.EntityInformation<T,ID> metadata, org.springframework.data.keyvalue.core.KeyValueOperations operations, RedisModulesOperations<?> rmo, RediSearchIndexer indexer, org.springframework.data.redis.core.mapping.RedisMappingContext mappingContext, com.google.gson.GsonBuilder gsonBuilder, RedisOMProperties properties)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    <S extends T>
    long
    count(org.springframework.data.domain.Example<S> example)
     
    byte[]
    createKey(String keyspace, String id)
     
    void
    delete(T entity)
     
    void
    deleteById(ID id, redis.clients.jedis.json.Path path)
     
    <S extends T>
    boolean
    exists(org.springframework.data.domain.Example<S> example)
     
    <S extends T>
    Iterable<S>
    findAll(org.springframework.data.domain.Example<S> example)
     
    <S extends T>
    org.springframework.data.domain.Page<S>
    findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Pageable pageable)
     
    <S extends T>
    Iterable<S>
    findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Sort sort)
     
     
    <S extends T, R>
    R
    findBy(org.springframework.data.domain.Example<S> example, Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>,R> queryFunction)
     
    <S extends T>
    Optional<S>
    findOne(org.springframework.data.domain.Example<S> example)
     
     
    <F> Iterable<F>
     
     
    org.springframework.data.domain.Page<ID>
    getIds(org.springframework.data.domain.Pageable pageable)
    Returns a Page of ids meeting the paging restriction provided in the Pageable object.
    <S extends T>
    List<S>
    saveAll(Iterable<S> entities)
     
    <S extends T>
    S
    update(S entity)
     
    void
    updateField(T entity, MetamodelField<T,?> field, Object value)
     

    Methods inherited from class org.springframework.data.keyvalue.repository.support.SimpleKeyValueRepository

    count, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAll, findAll, findById, save

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll
  • Field Details

    • modulesOperations

      protected final RedisModulesOperations<String> modulesOperations
    • metadata

      protected final org.springframework.data.repository.core.EntityInformation<T,ID> metadata
    • operations

      protected final org.springframework.data.keyvalue.core.KeyValueOperations operations
    • indexer

      protected final RediSearchIndexer indexer
    • mappingConverter

      protected final MappingRedisOMConverter mappingConverter
  • Constructor Details

    • SimpleRedisDocumentRepository

      public SimpleRedisDocumentRepository(org.springframework.data.repository.core.EntityInformation<T,ID> metadata, org.springframework.data.keyvalue.core.KeyValueOperations operations, @Qualifier("redisModulesOperations") RedisModulesOperations<?> rmo, RediSearchIndexer indexer, org.springframework.data.redis.core.mapping.RedisMappingContext mappingContext, com.google.gson.GsonBuilder gsonBuilder, RedisOMProperties properties)
  • Method Details

    • getIds

      public Iterable<ID> getIds()
      Specified by:
      getIds in interface RedisDocumentRepository<T,ID>
    • getIds

      public org.springframework.data.domain.Page<ID> getIds(org.springframework.data.domain.Pageable pageable)
      Description copied from interface: RedisDocumentRepository
      Returns a Page of ids meeting the paging restriction provided in the Pageable object.
      Specified by:
      getIds in interface RedisDocumentRepository<T,ID>
      Parameters:
      pageable - encapsulates pagination information
      Returns:
      a page of ids
    • deleteById

      public void deleteById(ID id, redis.clients.jedis.json.Path path)
      Specified by:
      deleteById in interface RedisDocumentRepository<T,ID>
    • updateField

      public void updateField(T entity, MetamodelField<T,?> field, Object value)
      Specified by:
      updateField in interface RedisDocumentRepository<T,ID>
    • getFieldsByIds

      public <F> Iterable<F> getFieldsByIds(Iterable<ID> ids, MetamodelField<T,F> field)
      Specified by:
      getFieldsByIds in interface RedisDocumentRepository<T,ID>
    • getExpiration

      public Long getExpiration(ID id)
      Specified by:
      getExpiration in interface RedisDocumentRepository<T,ID>
    • saveAll

      public <S extends T> List<S> saveAll(Iterable<S> entities)
      Specified by:
      saveAll in interface org.springframework.data.repository.CrudRepository<T,ID>
      Specified by:
      saveAll in interface org.springframework.data.repository.ListCrudRepository<T,ID>
      Overrides:
      saveAll in class org.springframework.data.keyvalue.repository.support.SimpleKeyValueRepository<T,ID>
    • bulkLoad

      public Iterable<T> bulkLoad(String file) throws IOException
      Specified by:
      bulkLoad in interface RedisDocumentRepository<T,ID>
      Throws:
      IOException
    • update

      public <S extends T> S update(S entity)
      Specified by:
      update in interface RedisDocumentRepository<T,ID>
    • delete

      public void delete(T entity)
      Specified by:
      delete in interface org.springframework.data.repository.CrudRepository<T,ID>
      Overrides:
      delete in class org.springframework.data.keyvalue.repository.support.SimpleKeyValueRepository<T,ID>
    • findAllById

      public List<T> findAllById(Iterable<ID> ids)
      Specified by:
      findAllById in interface org.springframework.data.repository.CrudRepository<T,ID>
      Specified by:
      findAllById in interface org.springframework.data.repository.ListCrudRepository<T,ID>
      Overrides:
      findAllById in class org.springframework.data.keyvalue.repository.support.SimpleKeyValueRepository<T,ID>
    • createKey

      public byte[] createKey(String keyspace, String id)
    • findOne

      public <S extends T> Optional<S> findOne(org.springframework.data.domain.Example<S> example)
      Specified by:
      findOne in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
    • findAll

      public <S extends T> Iterable<S> findAll(org.springframework.data.domain.Example<S> example)
      Specified by:
      findAll in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
    • findAll

      public <S extends T> Iterable<S> findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Sort sort)
      Specified by:
      findAll in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
    • findAll

      public <S extends T> org.springframework.data.domain.Page<S> findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Pageable pageable)
      Specified by:
      findAll in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
    • count

      public <S extends T> long count(org.springframework.data.domain.Example<S> example)
      Specified by:
      count in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
    • exists

      public <S extends T> boolean exists(org.springframework.data.domain.Example<S> example)
      Specified by:
      exists in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
    • findBy

      public <S extends T, R> R findBy(org.springframework.data.domain.Example<S> example, Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>,R> queryFunction)
      Specified by:
      findBy in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>