Select result = new Select(join, m_query.getFilter(), env);
Select result = new Select(join, filter, env);
    public Select generate() {        Signature sig = m_query.getSignature();        Environment env = new Environment            (Root.getRoot().getObjectMap(sig.getObjectType()));        for (Iterator it = sig.getSources().iterator(); it.hasNext(); ) {            Source src = (Source) it.next();            Join j;            if (isStatic(src)) {                SQLBlock block = getBlock(src);                Path alias = makeAlias(src.getPath(), "st_");                j = new StaticJoin		    (new StaticOperation(block, env, false), alias);            } else {                ObjectMap map =                    Root.getRoot().getObjectMap(src.getObjectType());                Table start = null;		ObjectMap om = map;		while (om != null) {		    start = om.getTable();		    if (start != null) {			break;		    }		    om = om.getSuperMap();		}                if (start == null) {                    throw new IllegalStateException			("can't find base table for type: " +			 map.getObjectType());                }                Path alias = makeAlias(src.getPath(), start);                j = new SimpleJoin(start, alias);                setColumns(src.getPath(),                           getPaths(alias, start.getPrimaryKey()));                setAlias(src.getPath(), start, alias);            }            setJoin(src, j);        }        for (Iterator it = sig.getPaths().iterator(); it.hasNext(); ) {            Path path = (Path) it.next();            genPath(path);        }        for (Iterator it = m_query.getOrder().iterator(); it.hasNext(); ) {            Expression e = (Expression) it.next();            generate(e);        }        generate(m_query.getFilter());        Join join = null;        for (Iterator it = sig.getSources().iterator(); it.hasNext(); ) {            Source src = (Source) it.next();            if (join == null) {                join = getJoin(src);            } else {                join = new CrossJoin(join, getJoin(src));            }        }        Select result = new Select(join, m_query.getFilter(), env);        result.setMappings(m_columns);        int col = 0;        for (Iterator it = sig.getPaths().iterator(); it.hasNext(); ) {            Path path = (Path) it.next();            result.addSelection(getColumn(path), "column" + (col++));        }        for (Iterator it = m_query.getOrder().iterator(); it.hasNext(); ) {            Expression e = (Expression) it.next();            result.addOrder(e, m_query.isAscending(e));        }        for (Iterator it = sig.getParameters().iterator(); it.hasNext(); ) {            Parameter param = (Parameter) it.next();            Path[] paths = RDBMSEngine.getKeyPaths                (param.getObjectType(), null);            for (int i = 0; i < paths.length; i++) {                result.set                    (Path.add(param.getPath(), paths[i]),                     RDBMSEngine.get(m_query.get(param), paths[i]),                     RDBMSEngine.getType                     (param.getObjectType().getType(paths[i]).getJavaClass()));            }        }        result.setLimit(m_query.getLimit());        result.setOffset(m_query.getOffset());        return result;    }