setQuery);
}
/** select c1 from g1 union select c2 from g2 union all select c3 from g3 union select c4 from g4 */
public void testThreeUnions(){
SetQuery setQuery = new SetQuery(Operation.UNION);
setQuery.setAll(false);
GroupSymbol g = new GroupSymbol("g1"); //$NON-NLS-1$
From from = new From();
from.addGroup(g);
Select select = new Select();
select.addSymbol(new ElementSymbol("c1")); //$NON-NLS-1$
Query query = new Query();
query.setSelect(select);
query.setFrom(from);
setQuery.setLeftQuery(query);
g = new GroupSymbol("g2"); //$NON-NLS-1$
from = new From();
from.addGroup(g);
select = new Select();
select.addSymbol(new ElementSymbol("c2")); //$NON-NLS-1$
query = new Query();
query.setSelect(select);
query.setFrom(from);
setQuery.setRightQuery(query);
g = new GroupSymbol("g3"); //$NON-NLS-1$
from = new From();
from.addGroup(g);
select = new Select();
select.addSymbol(new ElementSymbol("c3")); //$NON-NLS-1$
query = new Query();
query.setSelect(select);
query.setFrom(from);
setQuery = new SetQuery(SetQuery.Operation.UNION, true, setQuery, query);
g = new GroupSymbol("g4"); //$NON-NLS-1$
from = new From();
from.addGroup(g);
select = new Select();
select.addSymbol(new ElementSymbol("c4")); //$NON-NLS-1$
query = new Query();
query.setSelect(select);
query.setFrom(from);
setQuery = new SetQuery(SetQuery.Operation.UNION, false, setQuery, query);
TestParser.helpTest("select c1 from g1 union select c2 from g2 union all select c3 from g3 union select c4 from g4", //$NON-NLS-1$
"SELECT c1 FROM g1 UNION SELECT c2 FROM g2 UNION ALL SELECT c3 FROM g3 UNION SELECT c4 FROM g4", //$NON-NLS-1$
setQuery);
}