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 Example
s into KeyValueQuery
to execute its query
methods.
- Since:
- 2.1
- Author:
- Mark Paluch, Christoph Strobl
-
Constructor Summary
ConstructorDescriptionQueryByExampleRedisExecutor
(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) void
setBeanClassLoader
(ClassLoader classLoader) void
setBeanFactory
(org.springframework.beans.factory.BeanFactory beanFactory)
-
Constructor Details
-
QueryByExampleRedisExecutor
public QueryByExampleRedisExecutor(org.springframework.data.repository.core.EntityInformation<T, ?> entityInformation, RedisKeyValueTemplate keyValueTemplate) Create a newQueryByExampleRedisExecutor
givenEntityInformation
andRedisKeyValueTemplate
. This constructor uses the configuredIndexResolver
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) - 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 interfaceorg.springframework.beans.factory.BeanFactoryAware
- Throws:
org.springframework.beans.BeansException
-
setBeanClassLoader
- Specified by:
setBeanClassLoader
in interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
findOne
- Specified by:
findOne
in interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<T>
-
findAll
- Specified by:
findAll
in 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:
findAll
in 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:
findAll
in interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<T>
-
count
- Specified by:
count
in interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<T>
-
exists
- Specified by:
exists
in 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:
findBy
in interfaceorg.springframework.data.repository.query.QueryByExampleExecutor<T>
-