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; }
/** * 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; }
/** * 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); }
/** * 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); }
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(); }
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(); }
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(); }
@Override protected ParameterBinder createBinder(Object[] values) { return new SpelExpressionStringQueryParameterBinder((DefaultParameters) getQueryMethod().getParameters(), values, query, evaluationContextProvider, parser); }
protected ParameterBinder createBinder(Object[] values) { return new ParameterBinder((DefaultParameters) getQueryMethod().getParameters(), values); }
ParameterBinder(DefaultParameters parameters) { this(parameters, new Object[0]); }
/** * 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; }