Java Code Examples for

The following examples show how to use These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata, ProjectionFactory factory,
		NamedQueries namedQueries) {

	QueryMethod queryMethod = new QueryMethod(method, metadata, factory);

	Constructor<? extends KeyValuePartTreeQuery> constructor = (Constructor<? extends KeyValuePartTreeQuery>) ClassUtils
			.getConstructorIfAvailable(this.repositoryQueryType, QueryMethod.class,
					QueryMethodEvaluationContextProvider.class, KeyValueOperations.class, Class.class);

	Assert.state(constructor != null,
					"Constructor %s(QueryMethod, EvaluationContextProvider, KeyValueOperations, Class) not available!",

	return BeanUtils.instantiateClass(constructor, queryMethod, evaluationContextProvider, this.keyValueOperations,
Example 2
 * Detects the query creator type to be used for the factory to set. Will lookup a {@link QueryCreatorType} annotation
 * on the {@code @Enable}-annotation or use {@link SpelQueryCreator} if not found.
 * @param config
 * @return
private static Class<?> getQueryType(AnnotationRepositoryConfigurationSource config) {

	AnnotationMetadata metadata = config.getEnableAnnotationMetadata();

	Map<String, Object> queryCreatorAnnotationAttributes = metadata

	if (queryCreatorAnnotationAttributes == null) {
		return KeyValuePartTreeQuery.class;

	AnnotationAttributes queryCreatorAttributes = new AnnotationAttributes(queryCreatorAnnotationAttributes);
	return queryCreatorAttributes.getClass("repositoryQueryType");
Example 3
@Test // DATAKV-123
public void createsRepositoryFactory() {

	Class<? extends AbstractQueryCreator<?, ?>> creatorType = (Class<? extends AbstractQueryCreator<?, ?>>) mock(
	Class<? extends RepositoryQuery> queryType = mock(KeyValuePartTreeQuery.class).getClass();


Example 4
Source Project: spring-vault   Source File:    License: Apache License 2.0 4 votes vote down vote up
public VaultRepositoryFactory(KeyValueOperations keyValueOperations,
		Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {
	this(keyValueOperations, queryCreator, KeyValuePartTreeQuery.class);
Example 5
 * Creates a new {@link KeyValueRepositoryFactory} for the given {@link KeyValueOperations} and
 * {@link AbstractQueryCreator}-type.
 * @param keyValueOperations must not be {@literal null}.
 * @param queryCreator must not be {@literal null}.
public KeyValueRepositoryFactory(KeyValueOperations keyValueOperations,
		Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {

	this(keyValueOperations, queryCreator, KeyValuePartTreeQuery.class);