use of org.teiid.query.sql.lang.SubquerySetCriteria in project teiid by teiid.
the class TestSubqueryInCriteriaImpl method helpExample.
public static SubquerySetCriteria helpExample() {
// $NON-NLS-1$ //$NON-NLS-2$
ElementSymbol element = TestElementImpl.helpExample("g1", "e1");
Query query = TestQueryImpl.helpExample(true);
SubquerySetCriteria ssc = new SubquerySetCriteria(element, query);
ssc.setNegated(true);
return ssc;
}
use of org.teiid.query.sql.lang.SubquerySetCriteria in project teiid by teiid.
the class TestSubquerySetCriteria method example1.
public static SubquerySetCriteria example1() {
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 SubquerySetCriteria(new ElementSymbol("temp"), query);
}
use of org.teiid.query.sql.lang.SubquerySetCriteria in project teiid by teiid.
the class TestSubquerySetCriteria method testEquals2.
public void testEquals2() {
SubquerySetCriteria c1 = example1();
SubquerySetCriteria c2 = c1.clone();
// $NON-NLS-1$
assertTrue("Equivalent set criteria should have been equal.", c1.equals(c2));
}
use of org.teiid.query.sql.lang.SubquerySetCriteria in project teiid by teiid.
the class TestSubquerySetCriteria method testEquals1.
// ################################## ACTUAL TESTS ################################
public void testEquals1() {
SubquerySetCriteria c1 = example1();
SubquerySetCriteria c2 = example1();
// $NON-NLS-1$
assertTrue("Equivalent set criteria should have been equal.", c1.equals(c2));
}
use of org.teiid.query.sql.lang.SubquerySetCriteria in project teiid by teiid.
the class TestSubquerySetCriteria method example3.
public static SubquerySetCriteria 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 SubquerySetCriteria(new ElementSymbol("temp2"), query);
}
Aggregations