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

项目:spring-data-tarantool    文件:TarantoolQueryCreatorTest.java   
private TarantoolQueryCreator createQueryCreatorForMethodWithArgs(Method method, Object[] args) {

        PartTree partTree = new PartTree(method.getName(), method.getReturnType());
        TarantoolQueryCreator creator = new TarantoolQueryCreator(partTree, new ParametersParameterAccessor(new DefaultParameters(
                method), args));

        return creator;
    }
项目:spring-data-ebean    文件:SpelExpressionStringQueryParameterBinder.java   
/**
 * Creates a new {@link SpelExpressionStringQueryParameterBinder}.
 *
 * @param parameters                must not be {@literal null}
 * @param values                    must not be {@literal null}
 * @param query                     must not be {@literal null}
 * @param evaluationContextProvider must not be {@literal null}
 * @param parser                    must not be {@literal null}
 */
public SpelExpressionStringQueryParameterBinder(DefaultParameters parameters, Object[] values, StringQuery query,
                                                EvaluationContextProvider evaluationContextProvider, SpelExpressionParser parser) {

  super(parameters, values, query);
  Assert.notNull(evaluationContextProvider, "EvaluationContextProvider must not be null!");
  Assert.notNull(parser, "SpelExpressionParser must not be null!");

  this.evaluationContextProvider = evaluationContextProvider;
  this.query = query;
  this.parser = parser;
}
项目:spring-data-ebean    文件:PartTreeEbeanQuery.java   
/**
 * Creates a new {@link PartTreeEbeanQuery}.
 *
 * @param method      must not be {@literal null}.
 * @param ebeanServer must not be {@literal null}.
 */
public PartTreeEbeanQuery(EbeanQueryMethod method, EbeanServer ebeanServer) {
  super(method, ebeanServer);

  this.domainClass = method.getEntityInformation().getJavaType();
  this.tree = new PartTree(method.getName(), domainClass);
  this.parameters = (DefaultParameters) method.getParameters();
  this.queryPreparer = new QueryPreparer(ebeanServer);
}
项目:spring-data-ebean    文件:ParameterBinder.java   
/**
 * Creates a new {@link ParameterBinder}.
 *
 * @param parameters must not be {@literal null}.
 * @param values     must not be {@literal null}.
 */
public ParameterBinder(DefaultParameters parameters, Object[] values) {

    Assert.notNull(parameters, "Parameters must not be null!");
    Assert.notNull(values, "Values must not be null!");

    Assert.isTrue(parameters.getNumberOfParameters() == values.length, "Invalid number of parameters given!");

    this.parameters = parameters;
    this.values = values.clone();
    this.accessor = new ParametersParameterAccessor(parameters, this.values);
}
项目:spring-vault    文件:VaultQueryCreatorUnitTests.java   
VaultQuery createQuery(String methodName, String value) {

        DefaultParameters defaultParameters = new DefaultParameters(
                ReflectionUtils.findMethod(dummy.class, "someUnrelatedMethod",
                        String.class));

        PartTree partTree = new PartTree(methodName, Credentials.class);
        VaultQueryCreator queryCreator = new VaultQueryCreator(
                partTree,
                new ParametersParameterAccessor(defaultParameters, new Object[] { value }),
                mappingContext);

        return queryCreator.createQuery().getCriteria();
    }
项目:spring-vault    文件:VaultQueryCreatorUnitTests.java   
VaultQuery createQuery(String methodName, List<String> value) {

        DefaultParameters defaultParameters = new DefaultParameters(
                ReflectionUtils
                        .findMethod(dummy.class, "someUnrelatedMethod", List.class));

        PartTree partTree = new PartTree(methodName, Credentials.class);
        VaultQueryCreator queryCreator = new VaultQueryCreator(
                partTree,
                new ParametersParameterAccessor(defaultParameters, new Object[] { value }),
                mappingContext);

        return queryCreator.createQuery().getCriteria();
    }
项目:spring-vault    文件:VaultQueryCreatorUnitTests.java   
VaultQuery createQuery(String methodName, String value, String anotherValue) {

        DefaultParameters defaultParameters = new DefaultParameters(
                ReflectionUtils.findMethod(dummy.class, "someUnrelatedMethod",
                        String.class, String.class));

        PartTree partTree = new PartTree(methodName, Credentials.class);
        VaultQueryCreator queryCreator = new VaultQueryCreator(partTree,
                new ParametersParameterAccessor(defaultParameters, new Object[] { value,
                        anotherValue }), mappingContext);

        return queryCreator.createQuery().getCriteria();
    }
项目:spring-data-ebean    文件:AbstractStringBasedEbeanQuery.java   
@Override
protected ParameterBinder createBinder(Object[] values) {
  return new SpelExpressionStringQueryParameterBinder((DefaultParameters) getQueryMethod().getParameters(), values, query,
      evaluationContextProvider, parser);
}
项目:spring-data-ebean    文件:AbstractEbeanQuery.java   
protected ParameterBinder createBinder(Object[] values) {
  return new ParameterBinder((DefaultParameters) getQueryMethod().getParameters(), values);
}
项目:spring-data-ebean    文件:ParameterBinder.java   
ParameterBinder(DefaultParameters parameters) {
    this(parameters, new Object[0]);
}
项目:spring-data-ebean    文件:StringQueryParameterBinder.java   
/**
 * Creates a new {@link StringQueryParameterBinder} from the given {@link Parameters}, method arguments and
 * {@link StringQuery}.
 *
 * @param parameters must not be {@literal null}.
 * @param values     must not be {@literal null}.
 * @param query      must not be {@literal null}.
 */
public StringQueryParameterBinder(DefaultParameters parameters, Object[] values, StringQuery query) {

  super(parameters, values);

  Assert.notNull(query, "StringQuery must not be null!");
  this.query = query;
}