Package org.teiid.query.sql.visitor

Examples of org.teiid.query.sql.visitor.StaticSymbolMappingVisitor


        // Get old elements and groups
        List oldSymbols = (List) ElementCollectorVisitor.getElements(obj, false);
        GroupCollectorVisitor.getGroups(obj, oldSymbols);
       
        // Run symbol mapper
        StaticSymbolMappingVisitor visitor = new StaticSymbolMappingVisitor(symbolMap);
        DeepPreOrderNavigator.doVisit(obj, visitor);
       
        // Get new elements and groups
        List newSymbols = (List) ElementCollectorVisitor.getElements(obj, false);
        GroupCollectorVisitor.getGroups(obj, newSymbols);       
View Full Code Here


     elements.add(exampleElement(true, 0));   
     elements.add(exampleElement(true, 1));        
     aigs.setElementSymbols(elements);
    
        // Run symbol mapper
        StaticSymbolMappingVisitor visitor = new StaticSymbolMappingVisitor(getSymbolMap());
        DeepPreOrderNavigator.doVisit(aigs, visitor);

    // Check name of all in group symbol
    assertEquals("AllInGroupSymbol name did not get mapped correctly: ", "NEWG0.*", aigs.getName()); //$NON-NLS-1$ //$NON-NLS-2$
   }
View Full Code Here

        StoredProcedure exec = new StoredProcedure();
        exec.setProcedureName(exampleGroup(true, 1).getName());
        exec.setProcedureID("proc"); //$NON-NLS-1$

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

        // Check that group got mapped
        assertEquals("Procedure name did not get mapped correctly: ", exampleGroup(false, 1).getName(), exec.getProcedureName()); //$NON-NLS-1$
View Full Code Here

        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

       
        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

       
        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];
View Full Code Here

        CriteriaSelector selector = new CriteriaSelector();
        selector.setSelectorType(CriteriaSelector.COMPARE_EQ);
        selector.addElement(exampleElement(true, 1));
       
        // Run symbol mapper
        StaticSymbolMappingVisitor visitor = new StaticSymbolMappingVisitor(getSymbolMap());
        DeepPreOrderNavigator.doVisit(selector, visitor);
       
        // Check that element got mapped
        assertEquals("Criteria selector element did not get mapped correctly: ", exampleElement(false, 1), selector.getElements().get(0)); //$NON-NLS-1$
    }
View Full Code Here

    public void testTranslateCriteria() {
        TranslateCriteria trans = new TranslateCriteria();
        trans.addTranslation(new CompareCriteria(exampleElement(false, 1), CompareCriteria.EQ, exampleElement(false, 2)));

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

        // Check that element got mapped
        List elements = (List) ElementCollectorVisitor.getElements(trans, false);
        assertEquals("Translate criteria element did not get mapped correctly: ", exampleElement(false, 1), elements.get(0)); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.teiid.query.sql.visitor.StaticSymbolMappingVisitor

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.