Project

General

Profile

« Previous | Next » 

Revision 405

Added by berkley over 24 years ago

changed the field names to be case-sensitive in the returnfields

View differences:

src/edu/ucsb/nceas/metacat/QuerySpecification.java
306 306
    self.append("xml_nodes B where A.nodeid = B.parentnodeid ");
307 307
    self.append("and B.nodeid in ");
308 308
    self.append("(select distinct nodeid from xml_nodes where parentnodeid in ");
309
    self.append("(select nodeid from xml_index where UPPER(path) like '");
309
    self.append("(select nodeid from xml_index where path like '");
310 310
    boolean firstfield = true;
311 311
    //put the returnfields into the query
312 312
    //the for loop allows for multiple fields
......
315 315
      if(firstfield)
316 316
      {
317 317
        firstfield = false;
318
        self.append(((String)returnFieldList.elementAt(i)).toUpperCase());
318
        self.append((String)returnFieldList.elementAt(i));
319 319
        self.append("' ");
320 320
      }
321 321
      else
322 322
      {
323
        self.append("or UPPER(path) like '");
324
        self.append(((String)returnFieldList.elementAt(i)).toUpperCase());
323
        self.append("or path like '");
324
        self.append((String)returnFieldList.elementAt(i));
325 325
        self.append("' ");
326 326
      }
327 327
    }
......
330 330
    self.append(query.printSQL());
331 331
    self.append(")");
332 332
    self.append(" AND B.nodetype = 'TEXT'");
333
    
333

  
334 334
    return self.toString();
335 335
  }
336 336

  
......
557 557

  
558 558
/**
559 559
 * '$Log$
560
 * 'Revision 1.12  2000/08/23 17:29:05  berkley
561
 * 'added support for the returnfield parameter
562
 * '-QuerySpecification now sets a flag (containsExtendedSQL) when there are returnfield items in the pathquery document.
563
 * 'the accessor method containsExtendedSQL() can be called by other classes to check for extended return parameters
564
 * '-getReturnFields returns a Vector of the names of each specified return field.
565
 * '-printExtendedSQL returns a string of the extra SQL statements required for the query.
566
 * '
567
 * '-a calling class should first check containsExtendedSQL to make sure that there are extra fields being returned, then call printExtendedSQL to
568
 * 'insert the extra SQL into the query.  (Note that this is how DBQuery implements this.)
569
 * '
560 570
 * 'Revision 1.11  2000/08/14 20:53:34  jones
561 571
 * 'Added "release" keyword to all metacat source files so that the release
562 572
 * 'number will be evident in software distributions.
src/edu/ucsb/nceas/metacat/DBQuery.java
192 192
            document = new StringBuffer();
193 193

  
194 194
            document.append("<");
195
            document.append(fieldname.toLowerCase());
195
            document.append(fieldname);
196 196
            document.append(">");
197 197
            document.append(fielddata);
198 198
            document.append("</");
199
            document.append(fieldname.toLowerCase());
199
            document.append(fieldname);
200 200
            document.append(">");
201 201

  
202 202
            tableHasRows = rs.next();
......
441 441

  
442 442
/**
443 443
 * '$Log$
444
 * 'Revision 1.15  2000/08/23 17:22:07  berkley
445
 * 'added support for the returnfield parameter
446
 * '-added the dynamic parameters to the returned hash table of documents
447
 * '
444 448
 * 'Revision 1.14  2000/08/17 16:02:34  berkley
445 449
 * 'Made changes to createSQuery to allow for multiple parameters of the same name.  Also changed the param list to include only "Hashtable params" without a "String doctype" since the doctype is already contained in the params.
446 450
 * '

Also available in: Unified diff