You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2005/12/20 01:46:34 UTC

svn commit: r357854 - /incubator/roller/trunk/src/org/roller/business/hibernate/HibernateRefererManagerImpl.java

Author: snoopdave
Date: Mon Dec 19 16:46:31 2005
New Revision: 357854

URL: http://svn.apache.org/viewcvs?rev=357854&view=rev
Log:
Derby fix from Craig Russell

Modified:
    incubator/roller/trunk/src/org/roller/business/hibernate/HibernateRefererManagerImpl.java

Modified: incubator/roller/trunk/src/org/roller/business/hibernate/HibernateRefererManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/business/hibernate/HibernateRefererManagerImpl.java?rev=357854&r1=357853&r2=357854&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/business/hibernate/HibernateRefererManagerImpl.java (original)
+++ incubator/roller/trunk/src/org/roller/business/hibernate/HibernateRefererManagerImpl.java Mon Dec 19 16:46:31 2005
@@ -190,13 +190,14 @@
             } else if(con.getMetaData().getDriverName().startsWith("Apache Derby")) {
 	           // special handling for Derby
 				stmt = con.prepareStatement(
-				        "select u.username,w.name,w.name,sum(r.dayhits) as s "+
-				    "from rolleruser as u, website as w, referer as r "+
-				    "where r.websiteid=w.id and w.userid=u.id and w.isenabled=? " +
-				    "group by u.username,w.handle,w.id order by s desc");
+				    "select w.name, w.handle, w.id, sum(r.dayhits) as s "+
+				    "from website as w, referer as r "+
+				    "where r.websiteid=w.id and w.isenabled=? " +
+				    "group by w.name, w.handle, w.id order by s desc");                      
 				stmt.setBoolean(1, true);
+                stmt.setMaxRows(max);
             } else if(con.getMetaData().getDriverName().startsWith("IBM DB2")) {
-           // special handling for IBM DB2
+                // special handling for IBM DB2
                 stmt = con.prepareStatement(
                         "select u.username,w.name,w.name,sum(r.dayhits) as s "+
                         "from rolleruser as u, website as w, referer as r "+