use of org.teiid.query.sql.lang.CompareCriteria in project teiid by teiid.
the class TestSubqueryFromClause method example2.
public static SubqueryFromClause example2() {
Query query = new Query();
Select select = new Select();
// $NON-NLS-1$
select.addSymbol(new ElementSymbol("c"));
// $NON-NLS-1$
select.addSymbol(new ElementSymbol("d"));
query.setSelect(select);
From from = new From();
// $NON-NLS-1$
from.addGroup(new GroupSymbol("m.g2"));
query.setFrom(from);
CompareCriteria crit = new CompareCriteria();
// $NON-NLS-1$
crit.setLeftExpression(new ElementSymbol("c"));
crit.setRightExpression(new Constant(new Integer(10)));
crit.setOperator(CompareCriteria.EQ);
query.setCriteria(crit);
// $NON-NLS-1$
return new SubqueryFromClause("temp", query);
}
use of org.teiid.query.sql.lang.CompareCriteria in project teiid by teiid.
the class TestSubqueryFromClause method example3.
public static SubqueryFromClause example3() {
Query query = new Query();
Select select = new Select();
// $NON-NLS-1$
select.addSymbol(new ElementSymbol("a"));
// $NON-NLS-1$
select.addSymbol(new ElementSymbol("b"));
query.setSelect(select);
From from = new From();
// $NON-NLS-1$
from.addGroup(new GroupSymbol("m.g"));
query.setFrom(from);
CompareCriteria crit = new CompareCriteria();
// $NON-NLS-1$
crit.setLeftExpression(new ElementSymbol("a"));
crit.setRightExpression(new Constant(new Integer(5)));
crit.setOperator(CompareCriteria.EQ);
query.setCriteria(crit);
// $NON-NLS-1$
return new SubqueryFromClause("temp2", query);
}
Aggregations