if (offlimits) {
if (offlimitsAndCount) {
    public void write(Select select) {        boolean offlimits = (select.getOffset() != null                             || select.getLimit() != null);        if (offlimits) {            write("select * from (\n");        }        writeSelect(select);        Collection sels = select.getSelections();        Join join = select.getJoin();        Expression filter = select.getFilter();        if (offlimits) {            if (sels.size() == 0) {                write(", ");            } else {                write(",\n       ");            }            write("rownum as rownum__");        }        write("\nfrom ");        write(join);        filter = and(getJoinConditions(join), filter);        if (filter != null) {            write("\nwhere ");            write(filter);        }        writeOrder(select);        if (offlimits) {            write(")\nwhere ");        }        if (select.getOffset() != null) {            write("rownum__ > " + select.getOffset());            if (select.getLimit() != null) {                write("\nand ");            }        }        if (select.getLimit() != null) {            Integer upper;            if (select.getOffset() != null) {                upper = new Integer(select.getOffset().intValue() +                                    select.getLimit().intValue());            } else {                upper = select.getLimit();            }            write("rownum__ <= " + upper);        }        if (select.isCount()) {            write("\n) count__");        }    }