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 Summary
ConstructorsConstructorDescriptionQueryByExampleRedisExecutor(org.springframework.data.repository.core.EntityInformation<T, ?> entityInformation, RedisKeyValueTemplate keyValueTemplate) QueryByExampleRedisExecutor(org.springframework.data.repository.core.EntityInformation<T, ?> entityInformation, RedisKeyValueTemplate keyValueTemplate, IndexResolver indexResolver) -
Method Summary
Modifier and TypeMethodDescription<S extends T>
longcount(org.springframework.data.domain.Example<S> example) <S extends T>
booleanexists(org.springframework.data.domain.Example<S> example) 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) findAll(org.springframework.data.domain.Example<S> example, org.springframework.data.domain.Sort sort) <S extends T,R>
RfindBy(org.springframework.data.domain.Example<S> example, Function<org.springframework.data.repository.query.FluentQuery.FetchableFluentQuery<S>, R> queryFunction) findOne(org.springframework.data.domain.Example<S> example) voidsetBeanClassLoader(ClassLoader classLoader) voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
-
Constructor Details
-
QueryByExampleRedisExecutor
public QueryByExampleRedisExecutor(org.springframework.data.repository.core.EntityInformation<T, ?> entityInformation, RedisKeyValueTemplate keyValueTemplate) Create a newQueryByExampleRedisExecutorgivenEntityInformationandRedisKeyValueTemplate. This constructor uses the configuredIndexResolverfrom 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) - 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:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Throws:
org.springframework.beans.BeansException
-
setBeanClassLoader
- Specified by:
setBeanClassLoaderin interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
findOne
- Specified by:
findOnein interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<T>
-
findAll
- Specified by:
findAllin interfaceorg.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:
findAllin interfaceorg.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:
findAllin interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<T>
-
count
- Specified by:
countin interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<T>
-
exists
- Specified by:
existsin interfaceorg.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:
findByin interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<T>
-