当前位置: 首页>>代码示例>>Java>>正文


Java Key类代码示例

本文整理汇总了Java中org.springframework.data.repository.query.QueryLookupStrategy.Key的典型用法代码示例。如果您正苦于以下问题:Java Key类的具体用法?Java Key怎么用?Java Key使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Key类属于org.springframework.data.repository.query.QueryLookupStrategy包,在下文中一共展示了Key类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的package包/类
/**
 * Creates a {@link QueryLookupStrategy} for the given {@link EntityManager}
 * and {@link Key}.
 *
 * @param em                        must not be {@literal null}.
 * @param key                       may be {@literal null}.
 * @param extractor                 must not be {@literal null}.
 * @param evaluationContextProvider must not be {@literal null}.
 * @return
 */
public static QueryLookupStrategy create(Key key, EvaluationContextProvider evaluationContextProvider,
                                         SqlGenerator generator, NamedParameterJdbcTemplate template, RowMapper rowMapper,
                                         TableDescription tableDescription) {

    Assert.notNull(evaluationContextProvider, "EvaluationContextProvider must not be null!");

    switch (key != null ? key : Key.CREATE_IF_NOT_FOUND) {
        case CREATE:
            return new CreateQueryLookupStrategy(generator, template, rowMapper, tableDescription);
        case USE_DECLARED_QUERY:
            return new DeclaredQueryLookupStrategy(generator, template, rowMapper, tableDescription);
        case CREATE_IF_NOT_FOUND:
            return new CreateIfNotFoundQueryLookupStrategy(generator, template, rowMapper, tableDescription);
        default:
            throw new IllegalArgumentException(String.format("Unsupported query lookup strategy %s!", key));
    }
}
 
开发者ID:rubasace,项目名称:spring-data-jdbc,代码行数:28,代码来源:JdbcQueryLookupStrategy.java

示例2: create

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的package包/类
/**
 * Creates a {@link QueryLookupStrategy} for the given {@link EbeanServer} and {@link Key}.
 *
 * @param ebeanServer               must not be {@literal null}.
 * @param key                       may be {@literal null}.
 * @param evaluationContextProvider must not be {@literal null}.
 * @return
 */
public static QueryLookupStrategy create(EbeanServer ebeanServer, Key key,
                                         EvaluationContextProvider evaluationContextProvider) {

  Assert.notNull(ebeanServer, "EbeanServer must not be null!");
  Assert.notNull(evaluationContextProvider, "EvaluationContextProvider must not be null!");

  switch (key != null ? key : Key.CREATE_IF_NOT_FOUND) {
    case CREATE:
      return new CreateQueryLookupStrategy(ebeanServer);
    case USE_DECLARED_QUERY:
      return new DeclaredQueryLookupStrategy(ebeanServer, evaluationContextProvider);
    case CREATE_IF_NOT_FOUND:
      return new CreateIfNotFoundQueryLookupStrategy(ebeanServer, new CreateQueryLookupStrategy(ebeanServer),
          new DeclaredQueryLookupStrategy(ebeanServer, evaluationContextProvider));
    default:
      throw new IllegalArgumentException(String.format("Unsupported query lookup strategy %s!", key));
  }
}
 
开发者ID:hexagonframework,项目名称:spring-data-ebean,代码行数:27,代码来源:EbeanQueryLookupStrategy.java

示例3: create

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的package包/类
public static QueryLookupStrategy create(
        MybatisMappingContext context,
        SqlSessionTemplate sqlSessionTemplate,
        Dialect dialect,
        Key key,
        EvaluationContextProvider evaluationContextProvider) {
    Assert.notNull(evaluationContextProvider, "EvaluationContextProvider must not be null!");
    switch (key != null ? key : Key.CREATE_IF_NOT_FOUND) {
        case CREATE:
            return new CreateQueryLookupStrategy(context, sqlSessionTemplate, dialect);
        case USE_DECLARED_QUERY:
            return new DeclaredQueryLookupStrategy(sqlSessionTemplate, evaluationContextProvider);
        case CREATE_IF_NOT_FOUND:
            return new CreateIfNotFoundQueryLookupStrategy(
                    new CreateQueryLookupStrategy(context, sqlSessionTemplate, dialect),
                    new DeclaredQueryLookupStrategy(sqlSessionTemplate, evaluationContextProvider));
        default:
            throw new IllegalArgumentException(String.format("Unsupported query lookup strategy %s!", key));
    }
}
 
开发者ID:hatunet,项目名称:spring-data-mybatis,代码行数:21,代码来源:MybatisQueryLookupStrategy.java

示例4: create

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的package包/类
/**
 * Creates a {@link QueryLookupStrategy} for the given
 * {@link DynamoDBMapper} and {@link Key}.
 *
 * @param dynamoDBOperations
 * @param key
 * @return
 */
public static QueryLookupStrategy create(DynamoDBOperations dynamoDBOperations, Key key) {

	if (key == null) {
		return new CreateQueryLookupStrategy(dynamoDBOperations);
	}

	switch (key) {
	case CREATE:
		return new CreateQueryLookupStrategy(dynamoDBOperations);
	case USE_DECLARED_QUERY:
		throw new IllegalArgumentException(String.format("Unsupported query lookup strategy %s!", key));
	case CREATE_IF_NOT_FOUND:
		return new CreateIfNotFoundQueryLookupStrategy(dynamoDBOperations);
	default:
		throw new IllegalArgumentException(String.format("Unsupported query lookup strategy %s!", key));
	}
}
 
开发者ID:michaellavelle,项目名称:spring-data-dynamodb,代码行数:26,代码来源:DynamoDBQueryLookupStrategy.java

示例5: KeyValueQueryLookupStrategy

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的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;
}
 
开发者ID:spring-projects,项目名称:spring-data-keyvalue,代码行数:22,代码来源:KeyValueRepositoryFactory.java

示例6: getQueryLookupStrategy

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的package包/类
@Override
protected QueryLookupStrategy getQueryLookupStrategy(Key key, EvaluationContextProvider evaluationContextProvider) {

    return JdbcQueryLookupStrategy.create(key, evaluationContextProvider, generator, template, rowMapper, tableDescription);
}
 
开发者ID:rubasace,项目名称:spring-data-jdbc,代码行数:6,代码来源:JdbcRepositoryFactory.java

示例7: getQueryLookupStrategy

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的package包/类
@Override
protected QueryLookupStrategy getQueryLookupStrategy(Key key) {
	return new MongoQueryLookupStrategy();
}
 
开发者ID:wesley-ramos,项目名称:spring-multitenancy,代码行数:5,代码来源:MongoRepositoryFactory.java

示例8: getQueryLookupStrategy

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的package包/类
@Override
protected QueryLookupStrategy getQueryLookupStrategy(Key key, EvaluationContextProvider evaluationContextProvider) {
    return new ObjectifyQueryLookupStrategy(key, evaluationContextProvider);
}
 
开发者ID:nhuttrung,项目名称:spring-data-objectify,代码行数:5,代码来源:ObjectifyRepositoryFactory.java

示例9: getQueryLookupStrategy

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的package包/类
@Override
protected QueryLookupStrategy getQueryLookupStrategy(Key key, EvaluationContextProvider evaluationContextProvider) {
    return MybatisQueryLookupStrategy.create(mappingContext, sessionTemplate, dialect, key, evaluationContextProvider);
}
 
开发者ID:hatunet,项目名称:spring-data-mybatis,代码行数:5,代码来源:MybatisRepositoryFactory.java

示例10: getQueryLookupStrategy

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的package包/类
@Override
protected QueryLookupStrategy getQueryLookupStrategy(Key key,
    EvaluationContextProvider evaluationContextProvider) {
  return new AclQueryLookupStrategy(key, evaluationContextProvider);
}
 
开发者ID:lordlothar99,项目名称:strategy-spring-security-acl,代码行数:6,代码来源:AclJpaRepositoryFactoryBean.java

示例11: AclQueryLookupStrategy

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的package包/类
public AclQueryLookupStrategy(Key key, EvaluationContextProvider evaluationContextProvider) {
  this.key = key;
  this.evaluationContextProvider = evaluationContextProvider;
}
 
开发者ID:lordlothar99,项目名称:strategy-spring-security-acl,代码行数:5,代码来源:AclJpaRepositoryFactoryBean.java

示例12: getQueryLookupStrategy

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的package包/类
@Override
protected QueryLookupStrategy getQueryLookupStrategy(final Key key, final EvaluationContextProvider evaluationContextProvider) {
    return new MyBatisQueryLookupStrategy(mapperProvider, key);
}
 
开发者ID:create1st,项目名称:spring-boot-starter-mybatis,代码行数:5,代码来源:MyBatisRepositoryFactory.java

示例13: getQueryLookupStrategy

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的package包/类
@Override
protected QueryLookupStrategy getQueryLookupStrategy(Key key) {
	return new SolrQueryLookupStrategy();
}
 
开发者ID:yiduwangkai,项目名称:dubbox-solr,代码行数:5,代码来源:SolrRepositoryFactory.java

示例14: getQueryLookupStrategy

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的package包/类
@Override
protected Optional<QueryLookupStrategy> getQueryLookupStrategy(Key key, EvaluationContextProvider evaluationContextProvider) {
	return Optional.<QueryLookupStrategy> of(new GqQueryLookupStrategy(emf));
}
 
开发者ID:GeeQuery,项目名称:ef-orm,代码行数:5,代码来源:GqRepositoryFactory.java

示例15: getQueryLookupStrategy

import org.springframework.data.repository.query.QueryLookupStrategy.Key; //导入依赖的package包/类
@Override
protected Optional<QueryLookupStrategy> getQueryLookupStrategy(@Nullable Key key,
		EvaluationContextProvider evaluationContextProvider) {
	return Optional.of(new KeyValueQueryLookupStrategy(key, evaluationContextProvider, this.keyValueOperations,
			this.queryCreator, this.repositoryQueryType));
}
 
开发者ID:spring-projects,项目名称:spring-data-keyvalue,代码行数:7,代码来源:KeyValueRepositoryFactory.java


注:本文中的org.springframework.data.repository.query.QueryLookupStrategy.Key类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。