Example usage for org.springframework.integration.jpa.support JpaParameter getExpression

List of usage examples for org.springframework.integration.jpa.support JpaParameter getExpression

Introduction

In this page you can find the example usage for org.springframework.integration.jpa.support JpaParameter getExpression.

Prototype

@Nullable
    public String getExpression() 

Source Link

Usage

From source file:org.springframework.integration.jpa.support.parametersource.ExpressionEvaluatingParameterSource.java

public Object getValueByPosition(int position) {

    Assert.isTrue(position >= 0, "The position must be be non-negative.");

    if (position <= parameters.size()) {

        final JpaParameter parameter = parameters.get(position);

        if (parameter.getValue() != null) {
            return parameter.getValue();
        }/*from   w w  w.  jav a  2s.  co  m*/

        if (parameter.getExpression() != null) {
            String expression = parameter.getExpression();

            if (input instanceof Collection<?>) {
                expression = "#root.![" + expression + "]";
            }

            final Object value = this.expressionEvaluator.evaluateExpression(expression, input);
            //FIXME values.put(paramName, value);
            if (logger.isDebugEnabled()) {
                logger.debug("Resolved expression " + expression + " to " + value);
            }
            return value;

        }

    }

    return null;

}