roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r531060 - in /roller/trunk/src/org/apache/roller/business/hibernate: HibernateRefererManagerImpl.java HibernateWeblogManagerImpl.java
Date Sat, 21 Apr 2007 16:21:23 GMT
Author: snoopdave
Date: Sat Apr 21 09:21:21 2007
New Revision: 531060

URL: http://svn.apache.org/viewvc?view=rev&rev=531060
Log:
Switching to Number for SQL sum() results, it's safer than Integer

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

Modified: roller/trunk/src/org/apache/roller/business/hibernate/HibernateRefererManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/business/hibernate/HibernateRefererManagerImpl.java?view=diff&rev=531060&r1=531059&r2=531060
==============================================================================
--- roller/trunk/src/org/apache/roller/business/hibernate/HibernateRefererManagerImpl.java
(original)
+++ roller/trunk/src/org/apache/roller/business/hibernate/HibernateRefererManagerImpl.java
Sat Apr 21 09:21:21 2007
@@ -286,7 +286,7 @@
             Iterator rawResults = query.list().iterator();
             for (Iterator it = query.list().iterator(); it.hasNext();) {
                 Object[] row = (Object[])it.next();
-                Integer hits =        (Integer)row[0];
+                Number hits =          (Number)row[0];
                 String websiteId =     (String)row[1];
                 String websiteName =   (String)row[2];
                 String websiteHandle = (String)row[3];
@@ -340,11 +340,11 @@
         
         if (resultsArray.length > 0 && type.equals(DAYHITS)) {
             if ( resultsArray[0] != null ) {
-                hits = ((Integer) resultsArray[0]).intValue();
+                hits = ((Number) resultsArray[0]).intValue();
             }
         } else if ( resultsArray.length > 0 ) {
             if ( resultsArray[0] != null ) {
-                hits = ((Integer) resultsArray[1]).intValue();
+                hits = ((Number) resultsArray[1]).intValue();
             }
         } else {
             hits = 0;

Modified: roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java?view=diff&rev=531060&r1=531059&r2=531060
==============================================================================
--- roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java
(original)
+++ roller/trunk/src/org/apache/roller/business/hibernate/HibernateWeblogManagerImpl.java
Sat Apr 21 09:21:21 2007
@@ -1239,7 +1239,7 @@
                 Object[] row = (Object[]) iter.next();
                 TagStat t = new TagStat();
                 t.setName((String) row[0]);
-                t.setCount(((Integer) row[1]).intValue());                
+                t.setCount(((Number) row[1]).intValue());                
                 
                 min = Math.min(min, t.getCount());
                 max = Math.max(max, t.getCount());                
@@ -1306,7 +1306,7 @@
                 Object[] row = (Object[]) iter.next();
                 TagStat ce = new TagStat();
                 ce.setName((String) row[0]);
-                ce.setCount(((Integer) row[1]).intValue());
+                ce.setCount(((Number) row[1]).intValue());
                 results.add(ce);
             }
 



Mime
View raw message