public String buildQuery (INode home, INode nonvirtual, String kstr) {
public String buildQuery (INode home, INode nonvirtual, String kstr, String pre, boolean useOrder) {
    public String buildQuery (INode home, INode nonvirtual, String kstr) {	StringBuffer q = new StringBuffer ();	String prefix = " WHERE ";	if (kstr != null) {	    q.append (prefix);	    String accessColumn = accessor == null ? otherType.getIDField () : accessor;	    q.append (accessColumn);	    q.append (" = '");	    q.append (escape (kstr));	    q.append ("'");	    prefix = " AND ";	}	for (int i=0; i<constraints.length; i++) {	    q.append (prefix);	    constraints[i].addToQuery (q, home, nonvirtual);	    prefix = " AND ";	}		if (filter != null) {	    q.append (prefix);	    q.append (filter);	}	if (groupby != null)	    q.append (" GROUP BY "+groupby);	if (order != null)	    q.append (" ORDER BY "+order);	return q.toString ();    }