You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2008/06/27 11:41:29 UTC

svn commit: r672199 - /ofbiz/branches/release4.0/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java

Author: jleroux
Date: Fri Jun 27 02:41:29 2008
New Revision: 672199

URL: http://svn.apache.org/viewvc?rev=672199&view=rev
Log:
Applied fix from trunk for revision: 672198

Modified:
    ofbiz/branches/release4.0/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java

Modified: ofbiz/branches/release4.0/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java?rev=672199&r1=672198&r2=672199&view=diff
==============================================================================
--- ofbiz/branches/release4.0/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java (original)
+++ ofbiz/branches/release4.0/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java Fri Jun 27 02:41:29 2008
@@ -997,19 +997,20 @@
             ResultSet resultSet = sqlP.getResultSet();
             boolean isGroupBy = false;
             if (modelEntity instanceof ModelViewEntity) {
-              ModelViewEntity modelViewEntity = (ModelViewEntity) modelEntity;
-              String groupByString = modelViewEntity.colNameString(modelViewEntity.getGroupBysCopy(), ", ", "", false);
-
-              if (UtilValidate.isNotEmpty(groupByString)) isGroupBy = true;
+                ModelViewEntity modelViewEntity = (ModelViewEntity) modelEntity;
+                String groupByString = modelViewEntity.colNameString(modelViewEntity.getGroupBysCopy(), ", ", "", false);
+                if (UtilValidate.isNotEmpty(groupByString)) {
+                    isGroupBy = true;                  
+                }
             }
-
             if (isGroupBy) {
-              while (resultSet.next()) count++;
+                while (resultSet.next()) count++;
             }
             else if (resultSet.next()) {
                 count = resultSet.getLong(1);
             }
             return count;
+            
         } catch (SQLException e) {
             throw new GenericDataSourceException("Error getting count value", e);
         } finally {