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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

doogie-3
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);