docs: private String toSQLClause(ExistsCriteria c, ClassDescriptor cld)
      {
          StringBuffer buf = new StringBuffer();
          Query subQuery = (Query) c.getValue();
  
          buf.append(c.getClause());
          buf.append(" (");
  
          // If it's a proper call
          if (cld != null)
          {
              buf.append(
                  getPreparedSelectStatement(
                      subQuery,
                      cld.getRepository().getDescriptorFor(subQuery.getSearchClass())));
  
              // Otherwise it's most likely a call to toString()
          }
          else
          {
              buf.append(subQuery);
          }
  
          buf.append(")");
          return buf.toString();
      }