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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Feb 1 14:38:37 GMT 2016


Author: whalley
Date: Mon Feb  1 14:38:37 2016
New Revision: 1924

Log:
reorder by date/inspireid

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	Fri Jan 29 16:06:53 2016	(r1923)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query/ConstructQueryPaper.java	Mon Feb  1 14:38:37 2016	(r1924)
@@ -223,10 +223,11 @@
         else {
             b.append("select distinct {p1.*} from Papers {p1}");
         }
-        b.append(",DsKeywords dk1, Datasets d1");
+        b.append(",DsKeywords dk1, Datasets d1, PaperRefs pr1");
         for (int i=2; i<=queries.length; i++){
           String istr=String.valueOf(i);
           b.append(",Papers p"+istr);
+          b.append(",PaperRefs pr"+istr);
           b.append(",DsKeywords dk"+istr+", Datasets d"+istr);
         }
         for (int i=1; i<=queries.length; i++){
@@ -237,11 +238,12 @@
           }
           else{       b.append(" and p1.PAPER_ID=d"+istr+"._paper_PAPER_ID");}
           b.append("  and p1.PAPER_ID=p"+istr+".PAPER_ID");
+          b.append("  and p1.PAPER_ID=pr"+istr+".PAPER_ID");
           b.append("  and d"+istr+".DATASET_ID=dk"+istr+".DATASET_ID");
           b.append("  and dk"+istr+".Keyword like ");
           b.append("'"+queries[i-1]+"'");
         }
-        b.append(" order by p1.HepdataId desc");
+        b.append(" order by pr1.Date desc, p1.InspireId desc");
 
         if(flag.equals("count")){
            q = _session.createSQLQuery(b.toString());


More information about the HepData-svn mailing list