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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Apr 28 16:38:04 BST 2014


Author: whalley
Date: Mon Apr 28 16:38:03 2014
New Revision: 1789

Log:
tweak to AuthorDate search to stop multiple output

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 Apr 28 15:59:36 2014	(r1788)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/query/ConstructQueryPaper.java	Mon Apr 28 16:38:03 2014	(r1789)
@@ -737,10 +737,10 @@
        StringBuffer b = new StringBuffer();
            
        if (flag.equals("count")){
-     	   b.append("select count(p.HepdataId) from Papers p, PaperAuthors pa, PaperRefs pr");
+     	   b.append("select count(distinct p.HepdataId) from Papers p, PaperAuthors pa, PaperRefs pr");
        }
        else{
-     	   b.append("select * from Papers p, PaperAuthors pa, PaperRefs pr");
+     	   b.append("select distinct p.* from Papers p, PaperAuthors pa, PaperRefs pr");
       }
        b.append(" where p.PAPER_ID=pa.PAPER_ID");
        b.append(" and p.PAPER_ID=pr.PAPER_ID");
@@ -748,6 +748,7 @@
        b.append(author);
        b.append("' and pr.date like '");
        b.append(date);
+       b.append("' and pr.date not like '");
        b.append("' order by p.InspireId desc");
        if(flag.equals("count")){
            q = _session.createSQLQuery(b.toString());


More information about the HepData-svn mailing list