docs: protected void appendSQLClause(SelectionCriteria c, StringBuffer buf)
      {
          // BRJ : handle SqlCriteria
          if (c instanceof SqlCriteria)
          {
              buf.append(c.getAttribute());
              return;
          }
          
          // BRJ : criteria attribute is a query
          if (c.getAttribute() instanceof Query)
          {
              Query q = (Query) c.getAttribute();
              buf.append("(");
              buf.append(getSubQuerySQL(q));
              buf.append(")");
              buf.append(c.getClause());
              appendParameter(c.getValue(), buf);
              return;
          }
  
  		AttributeInfo attrInfo = getAttributeInfo((String) c.getAttribute(), false, c.getUserAlias(), c.getPathClasses());
          TableAlias alias = attrInfo.tableAlias;
  
          if (alias != null)
          {
              boolean hasExtents = alias.hasExtents();
  
              if (hasExtents)
              {
                  // BRJ : surround with braces if alias has extents
                  buf.append("(");
                  appendCriteria(alias, attrInfo.pathInfo, c, buf);
  
                  c.setNumberOfExtentsToBind(alias.extents.size());
                  Iterator iter = alias.iterateExtents();
                  while (iter.hasNext())
                  {
                      TableAlias tableAlias = (TableAlias) iter.next();
                      buf.append(" OR ");
                      appendCriteria(tableAlias, attrInfo.pathInfo, c, buf);
                  }
                  buf.append(")");
              }
              else
              {
                  // no extents
                  appendCriteria(alias, attrInfo.pathInfo, c, buf);
              }
          }
          else
          {
              // alias null
              appendCriteria(alias, attrInfo.pathInfo, c, buf);
          }
  
      }