Class QueryByExampleRedisExecutor<T>

java.lang.Object
org.springframework.data.redis.repository.support.QueryByExampleRedisExecutor<T>
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.data.repository.query.QueryByExampleExecutor<T>

public class QueryByExampleRedisExecutor<T> extends Object implements org.springframework.data.repository.query.QueryByExampleExecutor<T>, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanClassLoaderAware
Repository fragment implementing Redis Query-by-Example operations.

This executor uses ExampleQueryMapper to map Examples into KeyValueQuery to execute its query methods.

Since:
2.1
Author:
Mark Paluch, Christoph Strobl
  • Constructor Details

    • QueryByExampleRedisExecutor

      public QueryByExampleRedisExecutor(org.springframework.data.repository.core.EntityInformation<T,?> entityInformation, RedisKeyValueTemplate keyValueTemplate)
      Create a new QueryByExampleRedisExecutor given EntityInformation and RedisKeyValueTemplate. This constructor uses the configured IndexResolver from the converter.
      Parameters:
      entityInformation - must not be null.
      keyValueTemplate - must not be null.
    • QueryByExampleRedisExecutor

      public QueryByExampleRedisExecutor(org.springframework.data.repository.core.EntityInformation<T,?> entityInformation, RedisKeyValueTemplate keyValueTemplate, IndexResolver indexResolver)
      Create a new QueryByExampleRedisExecutor given EntityInformation and RedisKeyValueTemplate.
      Parameters:
      entityInformation - must not be null.
      keyValueTemplate - must not be null.
  • Method Details

    • setBeanFactory

      public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
      Specified by:
      setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
      Throws:
      org.springframework.beans.BeansException
    • setBeanClassLoader

      public void setBeanClassLoader(ClassLoader classLoader)
      Specified by:
      setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAware
    • 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>