Java 类org.springframework.data.repository.query.parser.AbstractQueryCreator 实例源码

项目:spring-data-tarantool    文件:TarantoolRepositoryFactoryBean.java   
@Override
protected TarantoolRepositoryFactory createRepositoryFactory(
        KeyValueOperations operations,
        Class<? extends AbstractQueryCreator<?, ?>> queryCreator,
        Class<? extends RepositoryQuery> repositoryQueryType
) {
    return new TarantoolRepositoryFactory(operations, queryCreator, repositoryQueryType);
}
项目:spring-data-tarantool    文件:TarantoolRepositoryFactory.java   
public TarantoolRepositoryFactory(
        KeyValueOperations keyValueOperations,
        Class<? extends AbstractQueryCreator<?, ?>> queryCreator,
        Class<? extends RepositoryQuery> repositoryQueryType
) {
    super(keyValueOperations, queryCreator, repositoryQueryType);
    this.keyValueOperations = keyValueOperations;
}
项目:spring-data-objectify    文件:ObjectifyRepositoryFactory.java   
public ObjectifyRepositoryFactory(Class<? extends AbstractQueryCreator<?, ?>> queryCreator,
                                  Class<? extends RepositoryQuery> repositoryQueryType,
                                  MappingContext<?, ?> mappingContext) {
    this.queryCreator = queryCreator;
    this.repositoryQueryType = repositoryQueryType;
    this.mappingContext = mappingContext;
}
项目:spring-vault    文件:VaultPartTreeQuery.java   
/**
 * 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()));
}
项目:spring-vault    文件:VaultRepositoryFactory.java   
public VaultRepositoryFactory(KeyValueOperations keyValueOperations,
        Class<? extends AbstractQueryCreator<?, ?>> queryCreator,
        Class<? extends RepositoryQuery> repositoryQueryType) {
    super(keyValueOperations, queryCreator, repositoryQueryType);

    this.operations = keyValueOperations;
}
项目:spring-vault    文件:VaultRepositoryFactoryBean.java   
@Override
protected VaultRepositoryFactory createRepositoryFactory(
        KeyValueOperations operations,
        Class<? extends AbstractQueryCreator<?, ?>> queryCreator,
        Class<? extends RepositoryQuery> repositoryQueryType) {

    return new VaultRepositoryFactory(operations, queryCreator, repositoryQueryType);
}
项目:spring-data-hazelcast    文件:HazelcastRepositoryFactory.java   
public HazelcastRepositoryFactory(KeyValueOperations keyValueOperations,
        Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {

    super(keyValueOperations, queryCreator);

    this.keyValueOperations = keyValueOperations;
    this.queryCreator = queryCreator;
}
项目:spring-data-keyvalue    文件:KeyValuePartTreeQuery.java   
/**
 * Create a {@link KeyValueQuery} given {@link ParameterAccessor}.
 *
 * @param accessor must not be {@literal null}.
 * @return the {@link KeyValueQuery}.
 */
public KeyValueQuery<?> createQuery(ParameterAccessor accessor) {

    PartTree tree = new PartTree(getQueryMethod().getName(), getQueryMethod().getEntityInformation().getJavaType());

    AbstractQueryCreator<? extends KeyValueQuery<?>, ?> queryCreator = queryCreatorFactory.queryCreatorFor(tree,
            accessor);

    KeyValueQuery<?> query = queryCreator.createQuery();

    if (tree.isLimiting()) {
        query.setRows(tree.getMaxResults());
    }
    return query;
}
项目:spring-data-keyvalue    文件:KeyValuePartTreeQuery.java   
@Override
public AbstractQueryCreator<KeyValueQuery<?>, ?> queryCreatorFor(PartTree partTree, ParameterAccessor accessor) {

    Assert.state(constructor != null,
            () -> String.format("No constructor (PartTree, ParameterAccessor) could be found on type %s!", type));
    return (AbstractQueryCreator<KeyValueQuery<?>, ?>) BeanUtils.instantiateClass(constructor, partTree, accessor);
}
项目:spring-data-keyvalue    文件:KeyValueRepositoryFactory.java   
/**
 * 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;
}
项目:spring-data-keyvalue    文件:KeyValueRepositoryFactory.java   
/**
 * @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;
}
项目:spring-data-keyvalue    文件:KeyValueRepositoryFactoryBeanUnitTests.java   
@SuppressWarnings("unchecked")
@Test(expected = IllegalArgumentException.class) // DATAKV-123
public void rejectsInstanceWithoutKeyValueOperations() {

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

    factoryBean.setQueryCreator(creatorType);
    factoryBean.afterPropertiesSet();
}
项目:spring-data-keyvalue    文件:KeyValueRepositoryFactoryBeanUnitTests.java   
@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()));
}
项目:spring-data-tarantool    文件:TarantoolRepositoryFactory.java   
public TarantoolRepositoryFactory(
        KeyValueOperations keyValueOperations,
        Class<? extends AbstractQueryCreator<?, ?>> queryCreator
) {
    this(keyValueOperations, queryCreator, KeyValuePartTreeQuery.class);
}
项目:spring-data-objectify    文件:ObjectifyRepositoryFactoryBean.java   
/**
 * Configures the {@link AbstractQueryCreator} to be used.
 * 
 * @param queryCreator must not be {@literal null}.
 */
public void setQueryCreator(Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {
    Assert.notNull(queryCreator, "Query creator type must not be null!");

    this.queryCreator = queryCreator;
}
项目:spring-vault    文件:VaultRepositoryFactory.java   
public VaultRepositoryFactory(KeyValueOperations keyValueOperations,
        Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {
    this(keyValueOperations, queryCreator, KeyValuePartTreeQuery.class);
}
项目:spring-data-hazelcast    文件:MyTitleRepositoryFactoryBean.java   
@Override
protected MyTitleRepositoryFactory createRepositoryFactory(KeyValueOperations operations,
        Class<? extends AbstractQueryCreator<?, ?>> queryCreator, Class<? extends RepositoryQuery> repositoryQueryType) {

    return new MyTitleRepositoryFactory(operations, queryCreator);
}
项目:spring-data-hazelcast    文件:MyTitleRepositoryFactory.java   
public MyTitleRepositoryFactory(KeyValueOperations keyValueOperations,
        Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {
    super(keyValueOperations, queryCreator);
    this.keyValueOperations = keyValueOperations;
}
项目:spring-data-keyvalue    文件:KeyValuePartTreeQuery.java   
ConstructorCachingQueryCreatorFactory(Class<? extends AbstractQueryCreator<?, ?>> type) {

            this.type = type;
            this.constructor = ClassUtils.getConstructorIfAvailable(type, PartTree.class, ParameterAccessor.class);
        }
项目:spring-data-keyvalue    文件:CachingKeyValuePartTreeQuery.java   
public CachingKeyValuePartTreeQuery(QueryMethod queryMethod, EvaluationContextProvider evaluationContextProvider,
        KeyValueOperations keyValueOperations, Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {
    super(queryMethod, evaluationContextProvider, keyValueOperations, queryCreator);
}
项目:spring-data-hazelcast    文件:HazelcastPartTreeQuery.java   
/**
 * <P>
 * Create a {@link RepositoryQuery} implementation for each query method defined in a {@link HazelcastRepository}.
 * </P>
 *
 * @param queryMethod Method defined in {@code HazelcastRepository}
 * @param evalulationContextProvider Not used
 * @param keyValueOperations Interface to Hazelcast
 * @param queryCreator Not used
 */
public HazelcastPartTreeQuery(QueryMethod queryMethod, EvaluationContextProvider evaluationContextProvider,
        KeyValueOperations keyValueOperations, Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {
    super(queryMethod, evaluationContextProvider, keyValueOperations, queryCreator);
    this.queryMethod = queryMethod;
    this.keyValueOperations = keyValueOperations;

    this.isRearrangeKnown = false;
}
项目:spring-data-hazelcast    文件:HazelcastRepositoryFactoryBean.java   
/**
 * <P>
 * Return a {@link HazelcastRepositoryFactory}.
 * </P>
 * <P>
 * {@code super} would return {@link KeyValueRepositoryFactory} which in turn builds {@link KeyValueRepository}
 * instances, and these have a private method that implement querying in a manner that does not fit with Hazelcast.
 * More details are in {@link HazelcastRepositoryFactory}.
 * </P>
 *
 * @param KeyValueOperations
 * @param Query Creator
 * @param RepositoryQueryType, not used
 * @return A {@link HazelcastRepositoryFactory} that creates {@link HazelcastRepository} instances.
 */
@Override
protected KeyValueRepositoryFactory createRepositoryFactory(KeyValueOperations operations,
        Class<? extends AbstractQueryCreator<?, ?>> queryCreator, Class<? extends RepositoryQuery> repositoryQueryType) {

    return new HazelcastRepositoryFactory(operations, queryCreator);
}
项目:spring-data-hazelcast    文件:HazelcastQueryLookupStrategy.java   
/**
 * <P>
 * Required constructor, capturing arguments for use in {@link #resolveQuery}.
 * </P>
 * <P>
 * Assertions copied from {@link KayValueRepositoryFactory.KeyValueQUeryLookupStrategy} which this class essentially
 * duplicates.
 * </P>
 *
 * @param key Not used
 * @param evaluationContextProvider For evaluation of query expressions
 * @param keyValueOperations Bean to use for Key/Value operations on Hazelcast repos
 * @param queryCreator Likely to be {@link HazelcastQueryCreator}
 */
public HazelcastQueryLookupStrategy(QueryLookupStrategy.Key key, EvaluationContextProvider evaluationContextProvider,
        KeyValueOperations keyValueOperations, Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {

    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!");

    this.evaluationContextProvider = evaluationContextProvider;
    this.keyValueOperations = keyValueOperations;
    this.queryCreator = queryCreator;
}
项目:spring-data-keyvalue    文件:KeyValuePartTreeQuery.java   
/**
 * Creates a new {@link KeyValuePartTreeQuery} 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}.
 */
public KeyValuePartTreeQuery(QueryMethod queryMethod, EvaluationContextProvider evaluationContextProvider,
        KeyValueOperations keyValueOperations, Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {

    this(queryMethod, evaluationContextProvider, keyValueOperations,
            new ConstructorCachingQueryCreatorFactory(queryCreator));
}
项目:spring-data-keyvalue    文件:KeyValueRepositoryFactoryBean.java   
/**
 * Configures the {@link QueryCreatorType} to be used.
 *
 * @param queryCreator must not be {@literal null}.
 */
public void setQueryCreator(Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {

    Assert.notNull(queryCreator, "Query creator type must not be null!");

    this.queryCreator = queryCreator;
}
项目:spring-data-keyvalue    文件:KeyValueRepositoryFactory.java   
/**
 * 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);
}
项目:spring-data-keyvalue    文件:KeyValueRepositoryFactory.java   
/**
 * Creates a new {@link KeyValueQueryLookupStrategy} for the given {@link Key}, {@link EvaluationContextProvider},
 * {@link KeyValueOperations} and query creator type.
 * <p>
 * TODO: Key is not considered. Should it?
 *
 * @param key
 * @param evaluationContextProvider must not be {@literal null}.
 * @param keyValueOperations must not be {@literal null}.
 * @param queryCreator must not be {@literal null}.
 */
public KeyValueQueryLookupStrategy(Key key, EvaluationContextProvider evaluationContextProvider,
        KeyValueOperations keyValueOperations, Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {
    this(key, evaluationContextProvider, keyValueOperations, queryCreator, KeyValuePartTreeQuery.class);
}
项目:spring-data-keyvalue    文件:KeyValueRepositoryFactoryBean.java   
/**
 * Create the repository factory to be used to create repositories.
 *
 * @param operations will never be {@literal null}.
 * @param queryCreator will never be {@literal null}.
 * @param repositoryQueryType will never be {@literal null}.
 * @return must not be {@literal null}.
 * @since 1.1
 */
protected KeyValueRepositoryFactory createRepositoryFactory(KeyValueOperations operations,
        Class<? extends AbstractQueryCreator<?, ?>> queryCreator, Class<? extends RepositoryQuery> repositoryQueryType) {

    return new KeyValueRepositoryFactory(operations, queryCreator, repositoryQueryType);
}