Revision 423
Added by berkley over 23 years ago
QuerySpecification.java | ||
---|---|---|
302 | 302 |
public String printExtendedSQL() |
303 | 303 |
{ |
304 | 304 |
StringBuffer self = new StringBuffer(); |
305 |
self.append("select A.docid, A.nodename, B.nodedata from xml_nodes A, "); |
|
306 |
self.append("xml_nodes B where A.nodeid = B.parentnodeid "); |
|
307 |
self.append("and B.nodeid in "); |
|
308 |
self.append("(select distinct nodeid from xml_nodes where parentnodeid in "); |
|
309 |
self.append("(select nodeid from xml_index where path like '"); |
|
305 |
self.append("select xml_nodes.docid, xml_index.path, xml_nodes.nodedata "); |
|
306 |
self.append("from xml_index, xml_nodes where xml_index.nodeid="); |
|
307 |
self.append("xml_nodes.parentnodeid and (xml_index.path like '"); |
|
310 | 308 |
boolean firstfield = true; |
311 | 309 |
//put the returnfields into the query |
312 | 310 |
//the for loop allows for multiple fields |
... | ... | |
320 | 318 |
} |
321 | 319 |
else |
322 | 320 |
{ |
323 |
self.append("or path like '"); |
|
321 |
self.append("or xml_index.path like '");
|
|
324 | 322 |
self.append((String)returnFieldList.elementAt(i)); |
325 | 323 |
self.append("' "); |
326 | 324 |
} |
327 | 325 |
} |
328 |
self.append("))"); |
|
329 |
self.append(" AND B.docid in ("); |
|
326 |
self.append(") AND xml_nodes.docid in ("); |
|
330 | 327 |
self.append(query.printSQL()); |
331 | 328 |
self.append(")"); |
332 |
self.append(" AND B.nodetype = 'TEXT'");
|
|
329 |
self.append(" AND xml_nodes.nodetype = 'TEXT'");
|
|
333 | 330 |
|
331 |
//System.out.println(self.toString()); |
|
334 | 332 |
return self.toString(); |
335 | 333 |
} |
336 | 334 |
|
... | ... | |
557 | 555 |
|
558 | 556 |
/** |
559 | 557 |
* '$Log$ |
558 |
* 'Revision 1.13 2000/08/23 22:55:38 berkley |
|
559 |
* 'changed the field names to be case-sensitive in the returnfields |
|
560 |
* ' |
|
560 | 561 |
* 'Revision 1.12 2000/08/23 17:29:05 berkley |
561 | 562 |
* 'added support for the returnfield parameter |
562 | 563 |
* '-QuerySpecification now sets a flag (containsExtendedSQL) when there are returnfield items in the pathquery document. |
Also available in: Unified diff
changed xslf for new returnfield scheme. the returnfields are now returned as <param name="<returnfield>"> tags.
hThe sql for the returnfield query was redone to fix a previous problem with slow queries