Package org.mule.module.db.internal.domain.query

Examples of org.mule.module.db.internal.domain.query.QueryParamValue


    {
        for (InputQueryParam param : queryTemplate.getInputParams())
        {
            Object value;

            QueryParamValue queryParamValue = getOverriddenParam(param.getName());
            if (queryParamValue != null)
            {
                value = queryParamValue.getValue();
            }
            else
            {
                value = param.getValue();
            }
View Full Code Here


            for (QueryParamValue templateParam : templateParams)
            {
                if (templateParam != null && templateParam.getValue() instanceof String && expressionManager.isExpression((String) templateParam.getValue()))
                {
                    Object newValue = expressionManager.evaluate((String) templateParam.getValue(), muleEvent);
                    QueryParamValue queryParamValue = new QueryParamValue(templateParam.getName(), newValue);

                    params.add(queryParamValue);
                }
                else
                {
View Full Code Here

    public void resolvesQuery() throws Exception
    {
        ParamValueResolver paramValueResolver = mock(ParamValueResolver.class);
        QueryResolver queryResolver = new ParametrizedQueryResolver(resolvedTemplateQuery, paramValueResolver);

        List<QueryParamValue> resolvedParams = Collections.singletonList(new QueryParamValue("param1", "foo"));
        when(paramValueResolver.resolveParams(muleEvent, resolvedTemplateQuery.getParamValues())).thenReturn(resolvedParams);

        Query resolvedQuery = queryResolver.resolve(null, muleEvent);

        assertThat(resolvedTemplateQuery, not(sameInstance(resolvedQuery)));
View Full Code Here

    @Test
    public void resolvesQueryWithUnresolvedTemplate() throws Exception
    {
        ParamValueResolver paramValueResolver = mock(ParamValueResolver.class);
        List<QueryParamValue> resolvedParams = Collections.singletonList(new QueryParamValue("param1", "foo"));
        when(paramValueResolver.resolveParams(muleEvent, unresolvedTemplateQuery.getParamValues())).thenReturn(resolvedParams);

        QueryResolver queryResolver = new ParametrizedQueryResolver(unresolvedTemplateQuery, paramValueResolver);

        DbConnection connection = mock(DbConnection.class);
View Full Code Here

        if (paramValues != null)
        {
            int paramIndex = 1;
            for (Object param : paramValues)
            {
                QueryParamValue paramValue = new QueryParamValue("param" + paramIndex++, param);
                queryParamValues.add(paramValue);
            }
        }

        return new Query(template, queryParamValues);
View Full Code Here

    {
        List<QueryParamValue> paramValues = new ArrayList<QueryParamValue>();
        int paramIndex =1;
        for (Object value : values)
        {
            QueryParamValue paramValue = new QueryParamValue("param" + paramIndex++, value);
            paramValues.add(paramValue);
        }

        return paramValues;
    }
View Full Code Here

        for (int paramIndex = 1, inputParamsSize = queryTemplate.getParams().size(); paramIndex <= inputParamsSize; paramIndex++)
        {
            QueryParam queryParam = queryTemplate.getParams().get(paramIndex - 1);
            if (queryParam instanceof InputQueryParam)
            {
                QueryParamValue param = paramValues.get(valueIndex);

                queryLogger.addParameter(queryTemplate.getInputParams().get(valueIndex), param.getValue());

                processInputParam(statement, paramIndex, param.getValue(), queryParam.getType());
                valueIndex++;
            }

            if (queryParam instanceof OutputQueryParam)
            {
View Full Code Here

TOP

Related Classes of org.mule.module.db.internal.domain.query.QueryParamValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.