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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Dec 2 16:51:16 GMT 2013


Author: whalley
Date: Mon Dec  2 16:51:16 2013
New Revision: 1722

Log:
trying to sort out the ordering of the records

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	Mon Dec  2 15:33:29 2013	(r1721)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query/ConstructQueryPaper.java	Mon Dec  2 16:51:16 2013	(r1722)
@@ -220,7 +220,7 @@
        b.append(" and dsobs.DATASET_ID=ds.DATASET_ID");
        
        b.append(" and p.PAPER_ID=ds._paper_PAPER_ID");
-       b.append(" order by p.SpiresId desc");
+       b.append(" order by p.InspireId desc");
 
        if(flag.equals("count")){
            q = _session.createSQLQuery(b.toString());
@@ -254,7 +254,7 @@
        b.append(" and dsreac.DATASET_ID=ds.DATASET_ID"); 
 
        b.append(" and p.PAPER_ID=ds._paper_PAPER_ID");
-       b.append(" order by p.SpiresId desc");
+       b.append(" order by p.InspireId desc");
 
        if(flag.equals("count")){
            q = _session.createSQLQuery(b.toString());
@@ -288,7 +288,7 @@
        b.append(" and dsreac.DATASET_ID=ds.DATASET_ID"); 
        
        b.append(" and p.PAPER_ID=ds._paper_PAPER_ID");
-       b.append(" order by p.SpiresId desc");
+       b.append(" order by p.InspireId desc");
 
        if(flag.equals("count")){
            q = _session.createSQLQuery(b.toString());
@@ -315,13 +315,13 @@
        b.append(",AxisReactions ar");
        b.append(",FinalStates fs");
 
-       b.append(" where fs.ParticleName like 'JET'");
+       b.append(" where fs.ParticleName like 'JET%'");
        b.append(" and fs.REACTION_ID=ar.REACTION_ID");
        b.append(" and ar._yAxis_AXIS_ID=ya.AXIS_ID");
        b.append(" and ya._dataset_DATASET_ID=ds.DATASET_ID");
        
        b.append(" and p.PAPER_ID=ds._paper_PAPER_ID");
-       b.append(" order by p.SpiresId desc");
+       b.append(" order by p.InspireId desc");
 
        if(flag.equals("count")){
            q = _session.createSQLQuery(b.toString());
@@ -358,7 +358,7 @@
        b.append(" and ya._dataset_DATASET_ID=ds.DATASET_ID");
        
        b.append(" and p.PAPER_ID=ds._paper_PAPER_ID");
-       b.append(" order by p.SpiresId desc");
+       b.append(" order by p.InspireId desc");
 
        if(flag.equals("count")){
            q = _session.createSQLQuery(b.toString());
@@ -395,7 +395,7 @@
        b.append(" and ya._dataset_DATASET_ID=ds.DATASET_ID");
        
        b.append(" and p.PAPER_ID=ds._paper_PAPER_ID");
-       b.append(" order by p.SpiresId desc");
+       b.append(" order by p.InspirsId desc");
 
        if(flag.equals("count")){
            q = _session.createSQLQuery(b.toString());
@@ -485,7 +485,7 @@
        b.append(" and ds.DATASET_ID=dr.DATASET_ID");
        if(dsobservable != null) {b.append(" and dr.DATASET_ID=do.DATASET_ID");}
        b.append(" and p.PAPER_ID=ds._paper_PAPER_ID");
-       b.append(" order by p.SpiresId desc");
+       b.append(" order by p.InspireId desc");
 
        System.out.println(b.toString());
 
@@ -519,9 +519,8 @@
        b.append(" or exp._informalName like '%");
        b.append(experiment);
        b.append("%')");
-           b.append(" and ref._date > 1900");
-//       b.append(" order by p._spiresId desc");
-            b.append(" order by ref._date desc");
+       b.append(" and ref._date > 1900");
+       b.append(" order by ref._date desc, p._inspireId desc");
        q = _session.createQuery(b.toString());
 //       System.out.println(q.toString());
 //       q.setString("exp",theExp);
@@ -561,7 +560,7 @@
            b.append(date);
            b.append(" and ref._date not like ''");
        }   
-       b.append(" order by p._spiresId desc");
+            b.append(" order by ref._date desc, p._inspireId desc");
 
        q = _session.createQuery(b.toString());
 //       System.out.println(q.toString());
@@ -586,7 +585,7 @@
        b.append(" where ref._description like '");
        b.append(reference);
        b.append("'");
-       b.append(" order by p._spiresId desc");
+       b.append(" order by ref._date desc, p._inspireId desc");
        q = _session.createQuery(b.toString());
 //       q.setString("ref",theRef);
        
@@ -616,7 +615,7 @@
            b.append(date);
            b.append(" and ref._date not like ''");
 	}   
-       b.append(" order by p._spiresId desc");
+        b.append(" order by ref._date desc, p._inspireId desc");
        q = _session.createQuery(b.toString());
 //       q.setString("date",theDate);
        
@@ -694,7 +693,7 @@
        }
        b.append(" where p._redId like '");
        b.append(redid);
-       b.append("' order by p._spiresId desc");
+       b.append("' order by p_.inspireId desc");
        q = _session.createQuery(b.toString());
        
        return q;
@@ -714,7 +713,7 @@
        b.append(" where p.PAPER_ID=pa.PAPER_ID");
        b.append(" and pa.element like '");
        b.append(author);
-       b.append("' order by p.SpiresId desc");
+       b.append("' order by p.InspireId desc");
        if(flag.equals("count")){
            q = _session.createSQLQuery(b.toString());
        }
@@ -886,7 +885,7 @@
 	        }
             b.append(" and ref.PAPER_ID=p.PAPER_ID");
 // sort 
-            b.append(" order by ref.Date desc");
+            b.append(" order by ref.Date desc, p.InspireId desc");
         }
   
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -944,7 +943,7 @@
 	        }
             b.append(" and ref.PAPER_ID=p.PAPER_ID");
 // sort 
-            b.append(" order by ref.Date desc");
+            b.append(" order by ref.Date desc, p.InspireId desc");
 	    }
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////
 // here if sqrtslo on its own ! just to test 
@@ -987,7 +986,7 @@
 	        }
             b.append(" and ref.PAPER_ID=p.PAPER_ID");
 // sort 
-            b.append(" order by ref.Date desc");
+            b.append(" order by ref.Date desc, p.InspireId desc");
 	    }
 ///////////////////////////////////////////////////////////////////////////////////////////
 // nothing left so must want everything !!
@@ -995,7 +994,7 @@
             b.append(",PaperRefs ref");
             b.append(" where ref.PAPER_ID=p.PAPER_ID");
 // sort 
-            b.append(" order by ref.Date desc");
+            b.append(" order by ref.Date desc, p.InspireId desc");
         }
 //////////////////////////////////////////////////////////////////////////////////////////////
 //create query


More information about the HepData-svn mailing list