Project

General

Profile

« Previous | Next » 

Revision 2634

Added by sgarg about 19 years ago

Fix for bug in QueryGroup. Didnt check if the QueryGroup returned empty string. E.g. in case of a % search.

View differences:

src/edu/ucsb/nceas/metacat/QueryGroup.java
96 96
      Enumeration en= getChildren();
97 97
      while (en.hasMoreElements()) {
98 98
        Object qobject = en.nextElement();
99

  
100 99
        if (qobject instanceof QueryGroup) {
101
          if (first) {
102
            first = false;
103
          } else {
104
             if(!queryString.toString().equals("")){
100
        	String queryGroupSQL = qg.printSQL(useXMLIndex);
101
        	if (first) {
102
        		first = false;
103
        	} else {
104
        		if(!queryString.toString().equals("") && queryGroupSQL != null &&!queryGroupSQL.equals("")){
105 105
                    queryString.append(" " + operator + " ");
106 106
             }
107
       		queryString.append(queryGroupSQL);
107 108
          }
108 109
          QueryGroup qg = (QueryGroup)qobject;
109 110
          queryString.append(qg.printSQL(useXMLIndex));
......
114 115
           QueryTerm qt = (QueryTerm)qobject;
115 116
           String termQueryString = qt.printSQL(useXMLIndex);
116 117
           if(!(qt.getSearchMode().equals("contains") && qt.getValue().equals("%"))){
117
               if (first) {
118
        	   if (first) {
118 119
                   first = false;
119 120
               } else {
120 121
                   if(!queryString.toString().equals("")){

Also available in: Unified diff