use of org.teiid.query.sql.symbol.GroupSymbol in project teiid by teiid.
the class TestCreate method sample2.
public static final Create sample2() {
Create create = new Create();
// $NON-NLS-1$
create.setTable(new GroupSymbol("temp_table2"));
List elements = new ArrayList();
// $NON-NLS-1$
elements.add(new ElementSymbol("a"));
// $NON-NLS-1$
elements.add(new ElementSymbol("b"));
create.setElementSymbolsAsColumns(elements);
return create;
}
use of org.teiid.query.sql.symbol.GroupSymbol in project teiid by teiid.
the class TestGroupCollectorVisitor method testUpdate.
public void testUpdate() {
GroupSymbol gs1 = exampleGroupSymbol(1);
Update update = new Update();
update.setGroup(gs1);
Set groups = new HashSet();
groups.add(gs1);
helpTestGroups(update, true, groups);
}
use of org.teiid.query.sql.symbol.GroupSymbol in project teiid by teiid.
the class TestGroupCollectorVisitor method testFrom1.
public void testFrom1() {
GroupSymbol gs1 = exampleGroupSymbol(1);
GroupSymbol gs2 = exampleGroupSymbol(2);
GroupSymbol gs3 = exampleGroupSymbol(3);
From from = new From();
from.addGroup(gs1);
from.addGroup(gs2);
from.addGroup(gs3);
Set groups = new HashSet();
groups.add(gs1);
groups.add(gs2);
groups.add(gs3);
helpTestGroups(from, true, groups);
}
use of org.teiid.query.sql.symbol.GroupSymbol in project teiid by teiid.
the class TestGroupCollectorVisitor method testBatchedUpdateCommand.
public void testBatchedUpdateCommand() {
GroupSymbol g1 = exampleGroupSymbol(1);
GroupSymbol g2 = exampleGroupSymbol(2);
GroupSymbol g3 = exampleGroupSymbol(3);
Insert insert = new Insert();
insert.setGroup(g1);
Update update = new Update();
update.setGroup(g2);
Delete delete = new Delete();
delete.setGroup(g3);
List updates = new ArrayList(3);
updates.add(insert);
updates.add(update);
updates.add(delete);
Set groups = new HashSet();
groups.add(g1);
groups.add(g2);
groups.add(g3);
helpTestGroups(new BatchedUpdateCommand(updates), true, groups);
}
use of org.teiid.query.sql.symbol.GroupSymbol in project teiid by teiid.
the class TestSetQuery method test2.
public void test2() {
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);
Query q2 = new Query();
select = new Select();
// $NON-NLS-1$
select.addSymbol(new ElementSymbol("y"));
q2.setSelect(select);
from = new From();
// $NON-NLS-1$
from.addGroup(new GroupSymbol("h"));
q2.setFrom(from);
SetQuery sq = new SetQuery(Operation.INTERSECT);
sq.setAll(false);
sq.setLeftQuery(q1);
sq.setRightQuery(q2);
assertEquals(// $NON-NLS-1$
"Query combiner string doesn't match expected: ", // $NON-NLS-1$
"SELECT x FROM g INTERSECT SELECT y FROM h", sq.toString());
}
Aggregations