Class QueryByExampleRedisExecutor<T>
java.lang.Object
org.springframework.data.redis.repository.support.QueryByExampleRedisExecutor<T>
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,ListQueryByExampleExecutor<T>
,QueryByExampleExecutor<T>
public class QueryByExampleRedisExecutor<T>
extends Object
implements ListQueryByExampleExecutor<T>, BeanFactoryAware, 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
ConstructorsConstructorDescriptionQueryByExampleRedisExecutor
(EntityInformation<T, ?> entityInformation, RedisKeyValueTemplate keyValueTemplate) QueryByExampleRedisExecutor
(EntityInformation<T, ?> entityInformation, RedisKeyValueTemplate keyValueTemplate, IndexResolver indexResolver) -
Method Summary
Modifier and TypeMethodDescription<S extends T>
long<S extends T>
boolean<S extends T,
R>
RfindBy
(Example<S> example, Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction) void
setBeanClassLoader
(ClassLoader classLoader) void
setBeanFactory
(BeanFactory beanFactory)
-
Constructor Details
-
QueryByExampleRedisExecutor
public QueryByExampleRedisExecutor(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(EntityInformation<T, ?> entityInformation, RedisKeyValueTemplate keyValueTemplate, IndexResolver indexResolver) - Parameters:
entityInformation
- must not be null.keyValueTemplate
- must not be null.
-
-
Method Details
-
setBeanFactory
- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Throws:
BeansException
-
setBeanClassLoader
- Specified by:
setBeanClassLoader
in interfaceBeanClassLoaderAware
-
findOne
- Specified by:
findOne
in interfaceQueryByExampleExecutor<T>
-
findAll
- Specified by:
findAll
in interfaceListQueryByExampleExecutor<T>
- Specified by:
findAll
in interfaceQueryByExampleExecutor<T>
-
findAll
- Specified by:
findAll
in interfaceListQueryByExampleExecutor<T>
- Specified by:
findAll
in interfaceQueryByExampleExecutor<T>
-
findAll
- Specified by:
findAll
in interfaceQueryByExampleExecutor<T>
-
count
- Specified by:
count
in interfaceQueryByExampleExecutor<T>
-
exists
- Specified by:
exists
in interfaceQueryByExampleExecutor<T>
-
findBy
public <S extends T,R> R findBy(Example<S> example, Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction) - Specified by:
findBy
in interfaceQueryByExampleExecutor<T>
-