use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class TestLoopStatement method query1.
// ################################## TEST HELPERS ################################
public static final Query query1() {
Query q1 = new Query();
Select select = new Select();
// $NON-NLS-1$
select.addSymbol(new ElementSymbol("x"));
q1.setSelect(select);
From from = new From();
// $NON-NLS-1$
from.addGroup(new GroupSymbol("g"));
q1.setFrom(from);
return q1;
}
use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class TestLoopStatement method query2.
public static final Query query2() {
Query q1 = new Query();
Select select = new Select();
// $NON-NLS-1$
select.addSymbol(new ElementSymbol("x2"));
q1.setSelect(select);
From from = new From();
// $NON-NLS-1$
from.addGroup(new GroupSymbol("g2"));
q1.setFrom(from);
return q1;
}
use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class TestDynamicCommand method testClone1.
public void testClone1() {
List symbols = new ArrayList();
// $NON-NLS-1$
ElementSymbol a1 = new ElementSymbol("a1");
a1.setType(DataTypeManager.DefaultDataClasses.STRING);
symbols.add(a1);
DynamicCommand sqlCmd = new DynamicCommand();
// $NON-NLS-1$
Expression sql = new Constant("SELECT a1 FROM g WHERE a2 = 5");
sqlCmd.setSql(sql);
sqlCmd.setAsColumns(symbols);
sqlCmd.setAsClauseSet(true);
// $NON-NLS-1$
sqlCmd.setIntoGroup(new GroupSymbol("#g"));
UnitTestUtil.helpTestEquivalence(0, sqlCmd, sqlCmd.clone());
}
use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class TestDynamicCommand method testClone2.
public void testClone2() {
List symbols = new ArrayList();
// $NON-NLS-1$
ElementSymbol a1 = new ElementSymbol("a1");
a1.setType(DataTypeManager.DefaultDataClasses.STRING);
symbols.add(a1);
// $NON-NLS-1$
Expression sql = new Constant("SELECT * FROM g");
SetClauseList using = new SetClauseList();
using.addClause(a1, a1);
// $NON-NLS-1$
DynamicCommand sqlCmd = new DynamicCommand(sql, symbols, new GroupSymbol("#g"), using);
UnitTestUtil.helpTestEquivalence(0, sqlCmd, sqlCmd.clone());
}
use of org.teiid.query.sql.symbol.ElementSymbol in project teiid by teiid.
the class TestMatchCriteria method example.
// ################################## TEST HELPERS ################################
public static MatchCriteria example(String element, String str) {
MatchCriteria crit = new MatchCriteria();
crit.setLeftExpression(new ElementSymbol(element));
crit.setRightExpression(new Constant(str));
return crit;
}
Aggregations