You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2010/06/02 23:24:20 UTC

svn commit: r950767 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java

Author: doogie
Date: Wed Jun  2 21:24:19 2010
New Revision: 950767

URL: http://svn.apache.org/viewvc?rev=950767&view=rev
Log:
Use the new isEmpty support in conditions to skip
EntityConditionListBase entries that have no children.

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java?rev=950767&r1=950766&r2=950767&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java Wed Jun  2 21:24:19 2010
@@ -770,13 +770,15 @@ public class GenericDAO {
         }
 
         List<EntityCondition> conditions = FastList.newInstance();
-        if (whereEntityCondition != null) {
+        if (whereEntityCondition != null && !whereEntityCondition.isEmpty()) {
             conditions.add(whereEntityCondition);
         }
 
         if (modelViewEntity != null && !viewWhereConditions.isEmpty()) {
             EntityCondition viewWhereEntityCondition = EntityCondition.makeCondition(viewWhereConditions);
-            conditions.add(viewWhereEntityCondition);
+            if (!viewWhereEntityCondition.isEmpty()) {
+                conditions.add(viewWhereEntityCondition);
+            }
         }
 
         String viewClause = SqlJdbcUtil.makeViewWhereClause(modelEntity, datasourceInfo.joinStyle);