本文整理汇总了Java中org.springframework.data.keyvalue.core.KeyValueOperations类的典型用法代码示例。如果您正苦于以下问题:Java KeyValueOperations类的具体用法?Java KeyValueOperations怎么用?Java KeyValueOperations使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KeyValueOperations类属于org.springframework.data.keyvalue.core包,在下文中一共展示了KeyValueOperations类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveQuery
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
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, EvaluationContextProvider.class,
KeyValueOperations.class, Class.class);
Assert.state(constructor != null,
String.format(
"Constructor %s(QueryMethod, EvaluationContextProvider, KeyValueOperations, Class) not available!",
ClassUtils.getShortName(this.repositoryQueryType)));
return BeanUtils.instantiateClass(constructor, queryMethod, evaluationContextProvider, this.keyValueOperations,
this.queryCreator);
}
示例2: createRepositoryFactory
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
@Override
protected TarantoolRepositoryFactory createRepositoryFactory(
KeyValueOperations operations,
Class<? extends AbstractQueryCreator<?, ?>> queryCreator,
Class<? extends RepositoryQuery> repositoryQueryType
) {
return new TarantoolRepositoryFactory(operations, queryCreator, repositoryQueryType);
}
示例3: TarantoolRepositoryFactory
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
public TarantoolRepositoryFactory(
KeyValueOperations keyValueOperations,
Class<? extends AbstractQueryCreator<?, ?>> queryCreator,
Class<? extends RepositoryQuery> repositoryQueryType
) {
super(keyValueOperations, queryCreator, repositoryQueryType);
this.keyValueOperations = keyValueOperations;
}
示例4: VaultPartTreeQuery
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
/**
* Creates a new {@link VaultPartTreeQuery} for the given {@link QueryMethod},
* {@link EvaluationContextProvider}, {@link KeyValueOperations} and query creator
* type.
*
* @param queryMethod must not be {@literal null}.
* @param evaluationContextProvider must not be {@literal null}.
* @param keyValueOperations must not be {@literal null}.
* @param queryCreator must not be {@literal null}.
*/
@SuppressWarnings("unchecked")
public VaultPartTreeQuery(QueryMethod queryMethod,
EvaluationContextProvider evaluationContextProvider,
KeyValueOperations keyValueOperations,
Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {
super(queryMethod, evaluationContextProvider, keyValueOperations,
new VaultQueryCreatorFactory(
(MappingContext) keyValueOperations.getMappingContext()));
}
示例5: VaultRepositoryFactory
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
public VaultRepositoryFactory(KeyValueOperations keyValueOperations,
Class<? extends AbstractQueryCreator<?, ?>> queryCreator,
Class<? extends RepositoryQuery> repositoryQueryType) {
super(keyValueOperations, queryCreator, repositoryQueryType);
this.operations = keyValueOperations;
}
示例6: createRepositoryFactory
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
@Override
protected VaultRepositoryFactory createRepositoryFactory(
KeyValueOperations operations,
Class<? extends AbstractQueryCreator<?, ?>> queryCreator,
Class<? extends RepositoryQuery> repositoryQueryType) {
return new VaultRepositoryFactory(operations, queryCreator, repositoryQueryType);
}
示例7: HazelcastRepositoryFactory
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
public HazelcastRepositoryFactory(KeyValueOperations keyValueOperations,
Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {
super(keyValueOperations, queryCreator);
this.keyValueOperations = keyValueOperations;
this.queryCreator = queryCreator;
}
示例8: KeyValuePartTreeQuery
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
/**
* Creates a new {@link KeyValuePartTreeQuery} for the given {@link QueryMethod}, {@link EvaluationContextProvider},
* {@link KeyValueOperations} using the given {@link QueryCreatorFactory} producing the {@link AbstractQueryCreator}
* in charge of altering the query.
*
* @param queryMethod must not be {@literal null}.
* @param evaluationContextProvider must not be {@literal null}.
* @param keyValueOperations must not be {@literal null}.
* @param queryCreatorFactory must not be {@literal null}.
* @since 2.0
*/
public KeyValuePartTreeQuery(QueryMethod queryMethod, EvaluationContextProvider evaluationContextProvider,
KeyValueOperations keyValueOperations, QueryCreatorFactory queryCreatorFactory) {
Assert.notNull(queryMethod, "Query method must not be null!");
Assert.notNull(evaluationContextProvider, "EvaluationContextprovider must not be null!");
Assert.notNull(keyValueOperations, "KeyValueOperations must not be null!");
Assert.notNull(queryCreatorFactory, "QueryCreatorFactory type must not be null!");
this.queryMethod = queryMethod;
this.keyValueOperations = keyValueOperations;
this.evaluationContextProvider = evaluationContextProvider;
this.queryCreatorFactory = queryCreatorFactory;
}
示例9: SimpleKeyValueRepository
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
/**
* Creates a new {@link SimpleKeyValueRepository} for the given {@link EntityInformation} and
* {@link KeyValueOperations}.
*
* @param metadata must not be {@literal null}.
* @param operations must not be {@literal null}.
*/
public SimpleKeyValueRepository(EntityInformation<T, ID> metadata, KeyValueOperations operations) {
Assert.notNull(metadata, "EntityInformation must not be null!");
Assert.notNull(operations, "KeyValueOperations must not be null!");
this.entityInformation = metadata;
this.operations = operations;
}
示例10: QuerydslKeyValueRepository
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
/**
* Creates a new {@link QuerydslKeyValueRepository} for the given {@link EntityInformation},
* {@link KeyValueOperations} and {@link EntityPathResolver}.
*
* @param entityInformation must not be {@literal null}.
* @param operations must not be {@literal null}.
* @param resolver must not be {@literal null}.
*/
public QuerydslKeyValueRepository(EntityInformation<T, ID> entityInformation, KeyValueOperations operations,
EntityPathResolver resolver) {
super(entityInformation, operations);
Assert.notNull(resolver, "EntityPathResolver must not be null!");
EntityPath<T> path = resolver.createPath(entityInformation.getJavaType());
this.builder = new PathBuilder<>(path.getType(), path.getMetadata());
}
示例11: KeyValueRepositoryFactory
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
/**
* 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}.
* @param repositoryQueryType must not be {@literal null}.
* @since 1.1
*/
public KeyValueRepositoryFactory(KeyValueOperations keyValueOperations,
Class<? extends AbstractQueryCreator<?, ?>> queryCreator, Class<? extends RepositoryQuery> repositoryQueryType) {
Assert.notNull(keyValueOperations, "KeyValueOperations must not be null!");
Assert.notNull(queryCreator, "Query creator type must not be null!");
Assert.notNull(repositoryQueryType, "RepositoryQueryType type must not be null!");
this.queryCreator = queryCreator;
this.keyValueOperations = keyValueOperations;
this.context = keyValueOperations.getMappingContext();
this.repositoryQueryType = repositoryQueryType;
}
示例12: KeyValueQueryLookupStrategy
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
/**
* @param key
* @param evaluationContextProvider
* @param keyValueOperations
* @param queryCreator
* @since 1.1
*/
public KeyValueQueryLookupStrategy(@Nullable Key key, EvaluationContextProvider evaluationContextProvider,
KeyValueOperations keyValueOperations, Class<? extends AbstractQueryCreator<?, ?>> queryCreator,
Class<? extends RepositoryQuery> repositoryQueryType) {
Assert.notNull(evaluationContextProvider, "EvaluationContextProvider must not be null!");
Assert.notNull(keyValueOperations, "KeyValueOperations must not be null!");
Assert.notNull(queryCreator, "Query creator type must not be null!");
Assert.notNull(repositoryQueryType, "RepositoryQueryType type must not be null!");
this.evaluationContextProvider = evaluationContextProvider;
this.keyValueOperations = keyValueOperations;
this.queryCreator = queryCreator;
this.repositoryQueryType = repositoryQueryType;
}
示例13: setup
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
@Before
public void setup() {
KeyValueOperations operations = new KeyValueTemplate(new MapKeyValueAdapter());
KeyValueRepositoryFactory keyValueRepositoryFactory = createKeyValueRepositoryFactory(operations);
this.repository = getRepository(keyValueRepositoryFactory);
}
示例14: createsRepositoryFactory
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
@Test // DATAKV-123
@SuppressWarnings("unchecked")
public void createsRepositoryFactory() {
Class<? extends AbstractQueryCreator<?, ?>> creatorType = (Class<? extends AbstractQueryCreator<?, ?>>) mock(
AbstractQueryCreator.class).getClass();
Class<? extends RepositoryQuery> queryType = mock(KeyValuePartTreeQuery.class).getClass();
factoryBean.setQueryCreator(creatorType);
factoryBean.setKeyValueOperations(mock(KeyValueOperations.class));
factoryBean.setQueryType(queryType);
assertThat(factoryBean.createRepositoryFactory(), is(notNullValue()));
}
开发者ID:spring-projects,项目名称:spring-data-keyvalue,代码行数:15,代码来源:KeyValueRepositoryFactoryBeanUnitTests.java
示例15: SimpleMapDbRepository
import org.springframework.data.keyvalue.core.KeyValueOperations; //导入依赖的package包/类
public SimpleMapDbRepository(EntityInformation<T, ID> metadata, KeyValueOperations operations) {
super(metadata, operations);
}