//sub command
Select innerSelect = new Select();
ElementSymbol e2inner = new ElementSymbol("e2"); //$NON-NLS-1$
innerSelect.addSymbol(e2inner);
From innerFrom = new From();
GroupSymbol pm4g1 = new GroupSymbol("pm4.g1"); //$NON-NLS-1$
innerFrom.addGroup(pm4g1);
Query innerQuery = new Query();
innerQuery.setSelect(innerSelect);
innerQuery.setFrom(innerFrom);
//outer command
Select outerSelect = new Select();
ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
outerSelect.addSymbol(e1);
From outerFrom = new From();
GroupSymbol pm1g1 = new GroupSymbol("pm1.g1"); //$NON-NLS-1$
outerFrom.addGroup(pm1g1);
ElementSymbol e2outer = new ElementSymbol("e2"); //$NON-NLS-1$
SubquerySetCriteria crit = new SubquerySetCriteria(e2outer, innerQuery);
Query outerQuery = new Query();
outerQuery.setSelect(outerSelect);