Expression expr = new ElementSymbol("b"); //$NON-NLS-1$
StoredProcedure exec = new StoredProcedure();
exec.setProcedureName("m.sq1"); //$NON-NLS-1$
Query query = new Query(new Select(Arrays.asList(new AllSymbol())), new From(Arrays.asList(new SubqueryFromClause("x", exec))), null, null, null);
SubquerySetCriteria subCrit = new SubquerySetCriteria(expr, query);
Query outer = new Query();
outer.setSelect(select);
outer.setFrom(from);
outer.setCriteria(subCrit);