Search in sources :

Example 31 with Constant

use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.

the class TestStaticSymbolMappingVisitor method testVisitInsert2.

public void testVisitInsert2() {
    Insert insert = new Insert();
    insert.setGroup(exampleGroup(true, 0));
    List values = new ArrayList();
    // $NON-NLS-1$
    values.add(new Constant("abc"));
    // $NON-NLS-1$
    values.add(new Constant("abc"));
    insert.setValues(values);
    helpTest(insert, getSymbolMap());
}
Also used : Constant(org.teiid.query.sql.symbol.Constant) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Insert(org.teiid.query.sql.lang.Insert)

Example 32 with Constant

use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.

the class TestStaticSymbolMappingVisitor method testVisitMatchCriteria.

public void testVisitMatchCriteria() {
    // $NON-NLS-1$
    MatchCriteria mc = new MatchCriteria(exampleElement(true, 0), new Constant("abc"));
    helpTest(mc, getSymbolMap());
}
Also used : MatchCriteria(org.teiid.query.sql.lang.MatchCriteria) Constant(org.teiid.query.sql.symbol.Constant)

Example 33 with Constant

use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.

the class TestStaticSymbolMappingVisitor method testVisitBetweenCriteria.

public void testVisitBetweenCriteria() {
    BetweenCriteria bc = new BetweenCriteria(exampleElement(true, 0), new Constant(new Integer(1000)), new Constant(new Integer(2000)));
    helpTest(bc, getSymbolMap());
}
Also used : BetweenCriteria(org.teiid.query.sql.lang.BetweenCriteria) Constant(org.teiid.query.sql.symbol.Constant)

Example 34 with Constant

use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.

the class TestStaticSymbolMappingVisitor method testVisitUpdate1.

public void testVisitUpdate1() {
    Update update = new Update();
    update.setGroup(exampleGroup(true, 0));
    // $NON-NLS-1$
    update.addChange(exampleElement(true, 0), new Constant("abc"));
    // $NON-NLS-1$
    update.addChange(exampleElement(true, 1), new Constant("abc"));
    helpTest(update, getSymbolMap());
}
Also used : Constant(org.teiid.query.sql.symbol.Constant) Update(org.teiid.query.sql.lang.Update)

Example 35 with Constant

use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.

the class TestSetCriteria method sample1.

public static final SetCriteria sample1() {
    SetCriteria c1 = new SetCriteria();
    // $NON-NLS-1$
    c1.setExpression(new ElementSymbol("e1"));
    List vals = new ArrayList();
    // $NON-NLS-1$
    vals.add(new Constant("a"));
    // $NON-NLS-1$
    vals.add(new Constant("b"));
    c1.setValues(vals);
    return c1;
}
Also used : ElementSymbol(org.teiid.query.sql.symbol.ElementSymbol) Constant(org.teiid.query.sql.symbol.Constant) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList)

Aggregations

Constant (org.teiid.query.sql.symbol.Constant)203 ElementSymbol (org.teiid.query.sql.symbol.ElementSymbol)94 Test (org.junit.Test)88 ArrayList (java.util.ArrayList)61 GroupSymbol (org.teiid.query.sql.symbol.GroupSymbol)48 List (java.util.List)38 Expression (org.teiid.query.sql.symbol.Expression)38 Function (org.teiid.query.sql.symbol.Function)31 CompareCriteria (org.teiid.query.sql.lang.CompareCriteria)25 Query (org.teiid.query.sql.lang.Query)22 Select (org.teiid.query.sql.lang.Select)15 Reference (org.teiid.query.sql.symbol.Reference)14 From (org.teiid.query.sql.lang.From)12 HashMap (java.util.HashMap)11 FunctionDescriptor (org.teiid.query.function.FunctionDescriptor)11 Criteria (org.teiid.query.sql.lang.Criteria)11 SetQuery (org.teiid.query.sql.lang.SetQuery)11 LinkedList (java.util.LinkedList)10 Limit (org.teiid.query.sql.lang.Limit)10 StoredProcedure (org.teiid.query.sql.lang.StoredProcedure)9