Project

General

Profile

« Previous | Next » 

Revision 2466

Added by sgarg over 19 years ago

Added a check if printAttributeQuery() for returnPath to see that it is not null so that that this doesnt happen

xml_index.path like 'null' AND xml_nodes.nodename like 'id'

View differences:

src/edu/ucsb/nceas/metacat/QuerySpecification.java
1093 1093
            String attributeName = (String) currentVector.elementAt(1);
1094 1094
            if (firstfield) {
1095 1095
                firstfield = false;
1096
                self.append("( xml_index.path like '");
1097
                self.append(returnPath);
1098
                self.append("' AND xml_nodes.nodename like '");
1096
                self.append("( ");
1097
                if(returnPath != null){
1098
                    self.append("xml_index.path like '");
1099
                    self.append(returnPath);
1100
                    self.append("' AND ");
1101
                }
1102
                self.append("xml_nodes.nodename like '");
1099 1103
                self.append(attributeName);
1100 1104
                self.append("') ");
1101 1105
            } else {
1102
                self.append(" or ( xml_index.path like '");
1103
                self.append(returnPath);
1104
                self.append("' AND xml_nodes.nodename like '");
1106
                self.append(" or (");
1107
                if(returnPath != null){
1108
                    self.append("xml_index.path like '");
1109
                    self.append(returnPath);
1110
                    self.append("' AND ");
1111
                }
1112
                self.append("xml_nodes.nodename like '");
1105 1113
                self.append(attributeName);
1106 1114
                self.append("') ");
1107 1115
            }

Also available in: Unified diff