Revision 3239
Added by Jing Tao over 17 years ago
src/edu/ucsb/nceas/metacat/QueryGroup.java | ||
---|---|---|
109 | 109 |
|
110 | 110 |
if (!queryTermsWithSameValue.isEmpty()) |
111 | 111 |
{ |
112 |
printSQLStringWithSameSearchValue(); |
|
112 |
String sameValueQueryString = printSQLStringWithSameSearchValue(); |
|
113 |
queryString.append(sameValueQueryString); |
|
113 | 114 |
} |
114 | 115 |
|
115 | 116 |
for (int i=0; i<queryGroupsChildren.size(); i++) |
... | ... | |
182 | 183 |
StringBuffer sqlBuff = new StringBuffer(); |
183 | 184 |
Vector pathVector = new Vector(); |
184 | 185 |
int index =0; |
185 |
|
|
186 | 186 |
if (queryTermsWithSameValue != null) |
187 | 187 |
{ |
188 | 188 |
boolean firstVector = true; |
189 | 189 |
for (int j=0; j<queryTermsWithSameValue.size(); j++) |
190 | 190 |
{ |
191 |
|
|
192 |
Vector queryTermVector = (Vector)queryTermsWithSameValue.elementAt(j); |
|
191 |
Vector queryTermVector = (Vector)queryTermsWithSameValue.elementAt(j); |
|
193 | 192 |
QueryTerm term1 = (QueryTerm)queryTermVector.elementAt(0); |
194 | 193 |
value = term1.getValue(); |
195 | 194 |
boolean first = true; |
... | ... | |
279 | 278 |
// currently we only handle UNION group |
280 | 279 |
if (newTerm != null ) |
281 | 280 |
{ |
281 |
//System.out.println("new term is not null branch in handle new query term"); |
|
282 | 282 |
//we only handle union operator now. |
283 | 283 |
if (operator != null && operator.equalsIgnoreCase(UNION)) |
284 | 284 |
{ |
285 |
//System.out.println("in only union branch in handle new query term"); |
|
285 | 286 |
for (int i=0; i<queryTerms.size(); i++) |
286 | 287 |
{ |
287 | 288 |
QueryTerm term = (QueryTerm)queryTerms.elementAt(i); |
288 | 289 |
if (term != null && term.hasSameSearchValue(newTerm)) |
289 | 290 |
{ |
291 |
//System.out.println("1Move a query term and add a new query term into search value in handle new query term"); |
|
290 | 292 |
// find a target which has same search value |
291 | 293 |
Vector newSameValueVector = new Vector(); |
292 | 294 |
newSameValueVector.add(term); |
... | ... | |
305 | 307 |
QueryTerm term = (QueryTerm)sameValueVec.elementAt(0); |
306 | 308 |
if (term != null && term.hasSameSearchValue(newTerm)) |
307 | 309 |
{ |
310 |
//System.out.println("2add a new query term into search value in handle new query term"); |
|
308 | 311 |
sameValueVec.add(newTerm); |
309 | 312 |
return; |
310 | 313 |
} |
Also available in: Unified diff
Fixed bug that modified query wasn't add.