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 Examples 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) voidsetBeanClassLoader(ClassLoader classLoader) voidsetBeanFactory(BeanFactory beanFactory)
-
Constructor Details
-
QueryByExampleRedisExecutor
public QueryByExampleRedisExecutor(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(EntityInformation<T, ?> entityInformation, RedisKeyValueTemplate keyValueTemplate, IndexResolver indexResolver) - Parameters:
entityInformation- must not be null.keyValueTemplate- must not be null.
-
-
Method Details
-
setBeanFactory
- Specified by:
setBeanFactoryin interfaceBeanFactoryAware- Throws:
BeansException
-
setBeanClassLoader
- Specified by:
setBeanClassLoaderin interfaceBeanClassLoaderAware
-
findOne
- Specified by:
findOnein interfaceQueryByExampleExecutor<T>
-
findAll
- Specified by:
findAllin interfaceListQueryByExampleExecutor<T>- Specified by:
findAllin interfaceQueryByExampleExecutor<T>
-
findAll
- Specified by:
findAllin interfaceListQueryByExampleExecutor<T>- Specified by:
findAllin interfaceQueryByExampleExecutor<T>
-
findAll
- Specified by:
findAllin interfaceQueryByExampleExecutor<T>
-
count
- Specified by:
countin interfaceQueryByExampleExecutor<T>
-
exists
- Specified by:
existsin interfaceQueryByExampleExecutor<T>
-
findBy
public <S extends T,R> R findBy(Example<S> example, Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction) - Specified by:
findByin interfaceQueryByExampleExecutor<T>
-