Package org.teiid.query.sql.lang

Examples of org.teiid.query.sql.lang.SPParameter


        return element;   
    }
   
    public void visit(StoredProcedure obj) {
      for (Iterator paramIter = obj.getInputParameters().iterator(); paramIter.hasNext();) {
      SPParameter param = (SPParameter) paramIter.next();
            Expression expr = param.getExpression();
            param.setExpression(replaceExpression(expr));
        }
    }
View Full Code Here


   
    public void testExecParamElement() {
        StoredProcedure exec = new StoredProcedure();
        exec.setProcedureName("pm1.proc1"); //$NON-NLS-1$
        exec.setProcedureID("proc"); //$NON-NLS-1$
        SPParameter param1 = new SPParameter(1, exampleElement(true, 1));
        exec.setParameter(param1);
       
        // Run symbol mapper
        StaticSymbolMappingVisitor visitor = new StaticSymbolMappingVisitor(getSymbolMap());
        DeepPreOrderNavigator.doVisit(exec, visitor);
       
        // Check that element got switched
        assertEquals("Stored proc param did not get mapped correctly: ", exampleElement(false, 1), param1.getExpression());    //$NON-NLS-1$
    }
View Full Code Here

        StoredProcedure exec = new StoredProcedure();
        exec.setProcedureName("pm1.proc1"); //$NON-NLS-1$
        exec.setProcedureID("proc"); //$NON-NLS-1$
        Function f = new Function("length", new Expression[] { exampleElement(true, 1) }); //$NON-NLS-1$
       
        SPParameter param1 = new SPParameter(1, f);
        exec.setParameter(param1);

        // Run symbol mapper
        StaticSymbolMappingVisitor visitor = new StaticSymbolMappingVisitor(getSymbolMap());
        DeepPreOrderNavigator.doVisit(exec, visitor);

        // Check that element got switched
        Function afterFunc = (Function) param1.getExpression();
        assertEquals("Stored proc param did not get mapped correctly: ", exampleElement(false, 1), afterFunc.getArg(0)); //$NON-NLS-1$
    }
View Full Code Here

        exec.setProcedureName("pm1.proc1"); //$NON-NLS-1$
        exec.setProcedureID("proc"); //$NON-NLS-1$       
        Function f = new Function("length", new Expression[] { exampleElement(true, 1) }); //$NON-NLS-1$
        Function f2 = new Function("+", new Expression[] { f, new Constant(new Integer(1)) })//$NON-NLS-1$
       
        SPParameter param1 = new SPParameter(1, f2);
        exec.setParameter(param1);

        // Run symbol mapper
        StaticSymbolMappingVisitor visitor = new StaticSymbolMappingVisitor(getSymbolMap());
        DeepPreOrderNavigator.doVisit(exec, visitor);

        // Check that element got switched
        Function afterFunc = (Function) param1.getExpression();
        Function innerFunc = (Function) afterFunc.getArgs()[0];
        assertEquals("Stored proc param did not get mapped correctly: ", exampleElement(false, 1), innerFunc.getArg(0)); //$NON-NLS-1$
    }
View Full Code Here

TOP

Related Classes of org.teiid.query.sql.lang.SPParameter

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.