[HepData-svn] r1834 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Nov 20 15:03:35 GMT 2014


Author: whalley
Date: Thu Nov 20 15:03:35 2014
New Revision: 1834

Log:
fixx to make sqrts searches apply to all types, including sqrts/nucleon

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query/ConstructQueryPaper.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query/ConstructQueryPaper.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query/ConstructQueryPaper.java	Tue Nov 11 15:17:36 2014	(r1833)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query/ConstructQueryPaper.java	Thu Nov 20 15:03:35 2014	(r1834)
@@ -896,10 +896,10 @@
                 b.append("' and do.DATASET_ID=ds.DATASET_ID");
             }
 	        if ( sqrts != null && !sqrts.equals("") && !sqrts.equals("null") ) {
-                if(sqrtstype.equals(">")){ b.append(" and bp.Name like 'sqrts' and bp.LowValue>"+sqrts);} 
-                else if(sqrtstype.equals("<")){b.append(" and bp.Name like 'sqrts' and bp.HighValue<"+sqrts);}
+                if(sqrtstype.equals(">")){ b.append(" and bp.Name like 'sqrts%' and bp.LowValue>"+sqrts);} 
+                else if(sqrtstype.equals("<")){b.append(" and bp.Name like 'sqrts%' and bp.HighValue<"+sqrts);}
                 else{
-                    b.append(" and bp.Name like 'sqrts' and bp.LowValue>="+sqrts);
+                    b.append(" and bp.Name like 'sqrts%' and bp.LowValue>="+sqrts);
                     b.append(" and bp.HighValue<="+sqrts);
                 }
                 b.append(" and bp.PROPERTY_ID=ap.PROPERTY_ID");
@@ -954,10 +954,10 @@
             b.append(observable);
             b.append("' and do.DATASET_ID=ds.DATASET_ID");
 	        if ( sqrts != null && !sqrts.equals("") && !sqrts.equals("null") ) {
-                if(sqrtstype.equals(">")){b.append(" and bp.Name like 'sqrts' and bp.LowValue>"+sqrts);} 
-                else if(sqrtstype.equals("<")){b.append(" and bp.Name like 'sqrts' and bp.HighValue<"+sqrts);}
+                if(sqrtstype.equals(">")){b.append(" and bp.Name like 'sqrts%' and bp.LowValue>"+sqrts);} 
+                else if(sqrtstype.equals("<")){b.append(" and bp.Name like 'sqrts%' and bp.HighValue<"+sqrts);}
                 else{
-                    b.append(" and bp.Name like 'sqrts' and bp.LowValue>="+sqrts);
+                    b.append(" and bp.Name like 'sqrts%' and bp.LowValue>="+sqrts);
                     b.append(" and bp.HighValue<="+sqrts);
                 }
                 b.append(" and bp.PROPERTY_ID=ap.PROPERTY_ID");
@@ -999,10 +999,10 @@
             b.append(",BaseProperties bp");
 //where
             b.append(" where p.PAPER_ID=ds._paper_PAPER_ID");
-            if(sqrtstype.equals(">"))    { b.append(" and bp.Name like 'sqrts' and bp.LowValue>"+sqrts);} 
-            else if(sqrtstype.equals("<")){b.append(" and bp.Name like 'sqrts' and bp.HighValue<"+sqrts);}
+            if(sqrtstype.equals(">"))    { b.append(" and bp.Name like 'sqrts%' and bp.LowValue>"+sqrts);} 
+            else if(sqrtstype.equals("<")){b.append(" and bp.Name like 'sqrts%' and bp.HighValue<"+sqrts);}
             else{
-                b.append(" and bp.Name like 'sqrts' and bp.LowValue>="+sqrts);
+                b.append(" and bp.Name like 'sqrts%' and bp.LowValue>="+sqrts);
                 b.append(" and bp.HighValue<="+sqrts);
             }
             b.append(" and bp.PROPERTY_ID=ap.PROPERTY_ID");


More information about the HepData-svn mailing list