You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jo...@apache.org on 2008/05/28 09:16:37 UTC

svn commit: r660840 - in /ofbiz/trunk/framework: common/webcommon/WEB-INF/actions/includes/ entity/src/org/ofbiz/entity/ entity/src/org/ofbiz/entity/condition/ entity/src/org/ofbiz/entity/finder/ entity/src/org/ofbiz/entity/test/ entityext/src/org/ofbi...

Author: jonesde
Date: Wed May 28 00:16:36 2008
New Revision: 660840

URL: http://svn.apache.org/viewvc?rev=660840&view=rev
Log:
More cleanups of now deprecated constructors and what what

Modified:
    ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/findAutocompleteOptions.bsh
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityDateFilterCondition.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityFieldMap.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityJoinOperator.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/OrderByItem.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
    ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java
    ofbiz/trunk/framework/example/webapp/example/WEB-INF/actions/includes/findExampleFeatures.bsh
    ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java
    ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java
    ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/ActivityIteratorCondExprBldr.java
    ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/BaseEntityCondExprBldr.java
    ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/ProcessMgrIteratorCondExprBldr.java
    ofbiz/trunk/framework/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java
    ofbiz/trunk/framework/shark/src/org/ofbiz/shark/repository/EntityRepositoryMgr.java
    ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.bsh
    ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/xmldsdump.bsh

Modified: ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/findAutocompleteOptions.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/findAutocompleteOptions.bsh?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/findAutocompleteOptions.bsh (original)
+++ ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/findAutocompleteOptions.bsh Wed May 28 00:16:36 2008
@@ -30,12 +30,12 @@
 andExprs = FastList.newInstance();
 fieldValue = request.getParameter(fieldName);
 if (UtilValidate.isNotEmpty(fieldValue)) {
-    andExprs.add(new EntityExpr(new EntityFunction.UPPER(new EntityFieldValue(fieldName)),
+    andExprs.add(EntityCondition.makeCondition(EntityFunction.UPPER(EntityFieldValue.makeFieldValue(fieldName)),
             EntityOperator.LIKE, "%" + fieldValue.toUpperCase() + "%"));
 }
 
 if (andExprs.size() > 0) {
-    entityConditionList = new EntityConditionList(andExprs, EntityOperator.AND);
+    entityConditionList = EntityCondition.makeCondition(andExprs, EntityOperator.AND);
     List autocompleteOptions = delegator.findList(entityName, entityConditionList, new TreeSet(StringUtil.toList(selectFields)), StringUtil.toList(sortByFields), null, false);
     context.put("autocompleteOptions", autocompleteOptions);
 }

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Wed May 28 00:16:36 2008
@@ -2060,7 +2060,7 @@
         List<EntityExpr> likeExpressions = FastList.newInstance();
         if (fieldMap != null) {
             for (Map.Entry<String, ? extends Object> fieldEntry: fieldMap.entrySet()) {
-                likeExpressions.add(new EntityExpr(fieldEntry.getKey(), EntityOperator.LIKE, fieldEntry.getValue()));
+                likeExpressions.add(EntityCondition.makeCondition(fieldEntry.getKey(), EntityOperator.LIKE, fieldEntry.getValue()));
             }
         }
         EntityConditionList<EntityExpr> ecl = EntityCondition.makeCondition(likeExpressions, EntityOperator.AND);
@@ -2075,7 +2075,7 @@
         List<EntityExpr> likeExpressions = FastList.newInstance();
         if (fields != null) {
             for (Map.Entry<String, ? extends Object> fieldEntry: fields.entrySet()) {
-                likeExpressions.add(new EntityExpr(fieldEntry.getKey(), EntityOperator.LIKE, fieldEntry.getValue()));
+                likeExpressions.add(EntityCondition.makeCondition(fieldEntry.getKey(), EntityOperator.LIKE, fieldEntry.getValue()));
             }
         }
         EntityConditionList<EntityExpr> ecl = EntityCondition.makeCondition(likeExpressions, EntityOperator.AND);
@@ -2090,7 +2090,7 @@
         List<EntityExpr> likeExpressions = FastList.newInstance();
         if (fields != null) {
             for (Map.Entry<String, ? extends Object> fieldEntry: fields.entrySet()) {
-                likeExpressions.add(new EntityExpr(fieldEntry.getKey(), EntityOperator.LIKE, fieldEntry.getValue()));
+                likeExpressions.add(EntityCondition.makeCondition(fieldEntry.getKey(), EntityOperator.LIKE, fieldEntry.getValue()));
             }
         }
         EntityConditionList<EntityExpr> ecl = EntityCondition.makeCondition(likeExpressions, EntityOperator.AND);
@@ -2357,7 +2357,7 @@
      *@deprecated Use findCountByCondition() instead
      */
     public long findCountByAnd(String entityName, Object... fields) throws GenericEntityException {
-        return findCountByCondition(entityName, new EntityFieldMap(UtilMisc.<String, Object>toMap(fields), EntityOperator.AND), null, null);
+        return findCountByCondition(entityName, EntityCondition.makeCondition(UtilMisc.<String, Object>toMap(fields), EntityOperator.AND), null, null);
     }
 
     /**
@@ -2365,7 +2365,7 @@
      *@deprecated Use findCountByCondition() instead
      */
     public long findCountByAnd(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException {
-        return findCountByCondition(entityName, new EntityFieldMap(fields, EntityOperator.AND), null, null);
+        return findCountByCondition(entityName, EntityCondition.makeCondition(fields, EntityOperator.AND), null, null);
     }
 
     /**

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java Wed May 28 00:16:36 2008
@@ -157,7 +157,7 @@
     }
 
     public EntityCondition freeze(Object lhs, Object rhs) {
-        return new EntityExpr(freeze(lhs), this, freeze(rhs));
+        return EntityCondition.makeCondition(freeze(lhs), this, freeze(rhs));
     }
 
     protected Object freeze(Object item) {

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityDateFilterCondition.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityDateFilterCondition.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityDateFilterCondition.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityDateFilterCondition.java Wed May 28 00:16:36 2008
@@ -96,17 +96,17 @@
     }
 
     public static EntityExpr makeCondition(Timestamp moment, String fromDateName, String thruDateName) {
-        return new EntityExpr(
-            new EntityExpr(
-                new EntityExpr( thruDateName, EntityOperator.EQUALS, null ),
+        return EntityCondition.makeCondition(
+            EntityCondition.makeCondition(
+                EntityCondition.makeCondition( thruDateName, EntityOperator.EQUALS, null ),
                 EntityOperator.OR,
-                new EntityExpr( thruDateName, EntityOperator.GREATER_THAN, moment )
+                EntityCondition.makeCondition( thruDateName, EntityOperator.GREATER_THAN, moment )
             ),
             EntityOperator.AND,
-            new EntityExpr(
-                new EntityExpr( fromDateName, EntityOperator.EQUALS, null ),
+            EntityCondition.makeCondition(
+                EntityCondition.makeCondition( fromDateName, EntityOperator.EQUALS, null ),
                 EntityOperator.OR,
-                new EntityExpr( fromDateName, EntityOperator.LESS_THAN_EQUAL_TO, moment )
+                EntityCondition.makeCondition( fromDateName, EntityOperator.LESS_THAN_EQUAL_TO, moment )
             )
        );
     }

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityExpr.java Wed May 28 00:16:36 2008
@@ -85,7 +85,7 @@
         }
         
         if (lhs instanceof String) {
-            this.lhs = new EntityFieldValue((String) lhs);
+            this.lhs = EntityFieldValue.makeFieldValue((String) lhs);
         } else {
             this.lhs = lhs;
         }

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityFieldMap.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityFieldMap.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityFieldMap.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityFieldMap.java Wed May 28 00:16:36 2008
@@ -49,7 +49,7 @@
         if (fieldMap == null) return new ArrayList<EntityExpr>();
         List<EntityExpr> list = new ArrayList<EntityExpr>(fieldMap.size());
         for (Map.Entry<String, ? extends Object> entry: fieldMap.entrySet()) {
-            list.add(new EntityExpr(entry.getKey(), op, entry.getValue()));
+            list.add(EntityCondition.makeCondition(entry.getKey(), op, entry.getValue()));
         }
         return list;
     }

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityJoinOperator.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityJoinOperator.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityJoinOperator.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityJoinOperator.java Wed May 28 00:16:36 2008
@@ -79,7 +79,7 @@
     }
 
     public EntityCondition freeze(Object lhs, Object rhs) {
-        return new EntityExpr(freeze(lhs), this, freeze(rhs));
+        return EntityCondition.makeCondition(freeze(lhs), this, freeze(rhs));
     }
 
     public EntityCondition freeze(List<? extends EntityCondition> conditionList) {

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/OrderByItem.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/OrderByItem.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/OrderByItem.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/OrderByItem.java Wed May 28 00:16:36 2008
@@ -111,13 +111,13 @@
             startIndex = 0;
             endIndex = text.length();
         }
-        EntityConditionValue value = new EntityFieldValue(text);
+        EntityConditionValue value = EntityFieldValue.makeFieldValue(text);
         switch (caseSensitivity) {
             case UPPER:
-                value = new EntityFunction.UPPER(value);
+                value = EntityFunction.UPPER(value);
                 break;
             case LOWER:
-                value = new EntityFunction.LOWER(value);
+                value = EntityFunction.LOWER(value);
                 break;
         }
         return new OrderByItem(value, descending);

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java Wed May 28 00:16:36 2008
@@ -43,6 +43,7 @@
 import org.ofbiz.entity.condition.EntityCondition;
 import org.ofbiz.entity.condition.EntityConditionList;
 import org.ofbiz.entity.condition.EntityExpr;
+import org.ofbiz.entity.condition.EntityFunction;
 import org.ofbiz.entity.condition.EntityJoinOperator;
 import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.entity.model.ModelEntity;
@@ -225,22 +226,22 @@
                 // since some databases don't consider nulls in != comparisons, explicitly include them
                 // this makes more sense logically, but if anyone ever needs it to not behave this way we should add an "or-null" attribute that is true by default
                 if (ignoreCase) {
-                    return new EntityExpr(
-                            new EntityExpr(fieldName, true, (EntityComparisonOperator) operator, value, true), 
+                    return EntityCondition.makeCondition(
+                            EntityCondition.makeCondition(EntityFunction.UPPER_FIELD(fieldName), (EntityComparisonOperator) operator, EntityFunction.UPPER(value)), 
                             EntityOperator.OR,
-                            new EntityExpr(fieldName, EntityOperator.EQUALS, null));
+                            EntityCondition.makeCondition(fieldName, EntityOperator.EQUALS, null));
                 } else {
-                    return new EntityExpr(
-                            new EntityExpr(fieldName, (EntityComparisonOperator) operator, value), 
+                    return EntityCondition.makeCondition(
+                            EntityCondition.makeCondition(fieldName, (EntityComparisonOperator) operator, value), 
                             EntityOperator.OR,
-                            new EntityExpr(fieldName, EntityOperator.EQUALS, null));
+                            EntityCondition.makeCondition(fieldName, EntityOperator.EQUALS, null));
                 }
             } else {
                 if (ignoreCase) {
                     // use the stuff to upper case both sides
-                    return new EntityExpr(fieldName, true, (EntityComparisonOperator) operator, value, true);
+                    return EntityCondition.makeCondition(EntityFunction.UPPER_FIELD(fieldName), (EntityComparisonOperator) operator, EntityFunction.UPPER(value));
                 } else {
-                    return new EntityExpr(fieldName, (EntityComparisonOperator) operator, value);
+                    return EntityCondition.makeCondition(fieldName, (EntityComparisonOperator) operator, value);
                 }
             }
         }

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java Wed May 28 00:16:36 2008
@@ -119,7 +119,7 @@
     public void testCreateTree() throws Exception {
         try {
         // get how many child nodes did we have before creating the tree
-        EntityCondition isChild = new EntityExpr("primaryParentNodeId", EntityOperator.NOT_EQUAL, GenericEntity.NULL_FIELD);
+        EntityCondition isChild = EntityCondition.makeCondition("primaryParentNodeId", EntityOperator.NOT_EQUAL, GenericEntity.NULL_FIELD);
         long alreadyStored = delegator.findCountByCondition("TestingNode", isChild, null, null);
 
         //
@@ -154,7 +154,7 @@
      */
     public void testAddMembersToTree() throws Exception {
         // get the level1 nodes
-        EntityCondition isLevel1 = new EntityExpr("primaryParentNodeId", EntityOperator.NOT_EQUAL, GenericEntity.NULL_FIELD);
+        EntityCondition isLevel1 = EntityCondition.makeCondition("primaryParentNodeId", EntityOperator.NOT_EQUAL, GenericEntity.NULL_FIELD);
         List<GenericValue> nodeLevel1 = delegator.findList("TestingNode", isLevel1, null, null, null, false);
 
         List<GenericValue> newValues = new LinkedList<GenericValue>();
@@ -190,7 +190,7 @@
      * Tests findByCondition and tests searching on a view-entity
      */
     public void testCountViews() throws Exception {
-        EntityCondition isNodeWithMember = new EntityExpr("testingId", EntityOperator.NOT_EQUAL, GenericEntity.NULL_FIELD);
+        EntityCondition isNodeWithMember = EntityCondition.makeCondition("testingId", EntityOperator.NOT_EQUAL, GenericEntity.NULL_FIELD);
         List<GenericValue> nodeWithMembers = delegator.findList("TestingNodeAndMember", isNodeWithMember, null, null, null, false);
 
         for (GenericValue v: nodeWithMembers) {
@@ -212,8 +212,8 @@
      */
     public void testFindDistinct() throws Exception {
         List<EntityExpr> exprList = UtilMisc.toList(
-                new EntityExpr("testingSize", EntityOperator.EQUALS, new Long(10)),
-                new EntityExpr("comments", EntityOperator.EQUALS, "No-comments"));
+                EntityCondition.makeCondition("testingSize", EntityOperator.EQUALS, new Long(10)),
+                EntityCondition.makeCondition("comments", EntityOperator.EQUALS, "No-comments"));
         EntityConditionList<EntityExpr> condition = EntityCondition.makeCondition(exprList);
 
         EntityFindOptions findOptions = new EntityFindOptions();
@@ -229,7 +229,7 @@
      * Tests a findByCondition using not like
      */
     public void testNotLike() throws Exception {
-        EntityCondition cond  = new EntityExpr("description", EntityOperator.NOT_LIKE, "root%");
+        EntityCondition cond  = EntityCondition.makeCondition("description", EntityOperator.NOT_LIKE, "root%");
         List<GenericValue> nodes = delegator.findList("TestingNode", cond, null, null, null, false);
         TestCase.assertTrue("Found nodes", nodes != null);
 
@@ -258,7 +258,7 @@
      */
     public void testForeignKeyRemove() throws Exception {
         try {
-            EntityCondition isLevel1 = new EntityExpr("description", EntityOperator.EQUALS, "node-level #1");
+            EntityCondition isLevel1 = EntityCondition.makeCondition("description", EntityOperator.EQUALS, "node-level #1");
             delegator.removeByCondition("TestingNode", isLevel1);
         } catch(GenericEntityException e) {
             Debug.logInfo(e.toString(), module);
@@ -296,7 +296,7 @@
      */
     public void testStoreByCondition() throws Exception {
         // change the description of all the level1 nodes
-        EntityCondition isLevel1 = new EntityExpr("description", EntityOperator.EQUALS, "node-level #1");
+        EntityCondition isLevel1 = EntityCondition.makeCondition("description", EntityOperator.EQUALS, "node-level #1");
         Map<String, String> fieldsToSet = UtilMisc.toMap("description", "node-level #1 (updated)");
         int n = 0;
         try {
@@ -317,7 +317,7 @@
         //
         // remove all the level1 nodes by using a condition on the description field
         //
-        EntityCondition isLevel1 = new EntityExpr("description", EntityOperator.EQUALS, "node-level #1 (updated)");
+        EntityCondition isLevel1 = EntityCondition.makeCondition("description", EntityOperator.EQUALS, "node-level #1 (updated)");
         int n = 0;
 
         try {
@@ -337,7 +337,7 @@
         // Find all the root nodes,
         // delete them their primary key
         //
-        EntityCondition isRoot = new EntityExpr("primaryParentNodeId", EntityOperator.EQUALS, GenericEntity.NULL_FIELD);
+        EntityCondition isRoot = EntityCondition.makeCondition("primaryParentNodeId", EntityOperator.EQUALS, GenericEntity.NULL_FIELD);
         List<GenericValue> rootValues = delegator.findList("TestingNode", isRoot, UtilMisc.toSet("testingNodeId"), null, null, false);
 
         for (GenericValue value: rootValues) {
@@ -406,7 +406,7 @@
      */
     public void testEntityListIterator() throws Exception {
         try {
-            EntityListIterator iterator = delegator.find("Testing", new EntityExpr("testingId", EntityOperator.LIKE, "T2-%"), null, null, null, null);
+            EntityListIterator iterator = delegator.find("Testing", EntityCondition.makeCondition("testingId", EntityOperator.LIKE, "T2-%"), null, null, null, null);
             assertTrue("Test if EntityListIterator was created: ", iterator != null);
 
             int i = 0;
@@ -422,7 +422,7 @@
             assertTrue("GenericEntityException:" + e.toString(), false);
             return;
         } finally {
-            List<GenericValue> entitiesToRemove = delegator.findList("Testing", new EntityExpr("testingId", EntityOperator.LIKE, "T2-%"), null, null, null, false);
+            List<GenericValue> entitiesToRemove = delegator.findList("Testing", EntityCondition.makeCondition("testingId", EntityOperator.LIKE, "T2-%"), null, null, null, false);
             delegator.removeAll(entitiesToRemove);
         }
     }

Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java (original)
+++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java Wed May 28 00:16:36 2008
@@ -263,7 +263,7 @@
         //    String op = (String)iterType.next();
         //    condList.add(EntityCondition.makeCondition(lcEntityName + "OperationId", op));
         //}
-        //EntityCondition opCond = new EntityConditionList(condList, EntityOperator.OR);
+        //EntityCondition opCond = EntityCondition.makeCondition(condList, EntityOperator.OR);
         
         EntityCondition opCond = EntityCondition.makeCondition(lcEntityName + "OperationId", EntityOperator.IN, targetOperationList);
         

Modified: ofbiz/trunk/framework/example/webapp/example/WEB-INF/actions/includes/findExampleFeatures.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/webapp/example/WEB-INF/actions/includes/findExampleFeatures.bsh?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/example/webapp/example/WEB-INF/actions/includes/findExampleFeatures.bsh (original)
+++ ofbiz/trunk/framework/example/webapp/example/WEB-INF/actions/includes/findExampleFeatures.bsh Wed May 28 00:16:36 2008
@@ -32,13 +32,13 @@
 andExprs = FastList.newInstance();
 fieldValue = request.getParameter("exampleFeatureId");
 if (UtilValidate.isNotEmpty(fieldValue)) {
-    andExprs.add(new EntityExpr(new EntityFunction.UPPER(new EntityFieldValue("exampleFeatureId")),
+    andExprs.add(EntityCondition.makeCondition(EntityFunction.UPPER(EntityFieldValue.makeFieldValue("exampleFeatureId")),
             EntityOperator.LIKE, "%" + fieldValue.toUpperCase() + "%"));
 }
 
 List autocompleteOptions = null;
 if (andExprs.size() > 0) {
-    entityConditionList = new EntityConditionList(andExprs, EntityOperator.AND);
+    entityConditionList = EntityCondition.makeCondition(andExprs, EntityOperator.AND);
     autocompleteOptions = delegator.findList("ExampleFeature", entityConditionList, new TreeSet(UtilMisc.toList("exampleFeatureId", "description")), UtilMisc.toList("-exampleFeatureId"), null, false);
     //context.put("autocompleteOptions", autocompleteOptions);
 	request.setAttribute("autocompleteOptions", autocompleteOptions);

Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java (original)
+++ ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java Wed May 28 00:16:36 2008
@@ -20,7 +20,6 @@
 
 import java.util.ArrayList;
 import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
@@ -226,13 +225,12 @@
             if (pkey != null) {
                 List<EntityExpr> expressions = new ArrayList<EntityExpr>();
                 for (String role: roles) {
-                    expressions.add(new EntityExpr("roleTypeId", EntityOperator.EQUALS, role));                    
+                    expressions.add(EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, role));                    
                 }
-                EntityConditionList<EntityExpr> exprList = new EntityConditionList<EntityExpr>(expressions, EntityOperator.OR);
-                EntityExpr keyExpr = new EntityExpr(pkey, EntityOperator.EQUALS, primaryKey);
-                EntityExpr partyExpr = new EntityExpr("partyId", EntityOperator.EQUALS, userLogin.getString("partyId"));
-                List<EntityCondition> joinList = UtilMisc.toList(exprList, keyExpr, partyExpr);
-                condition = new EntityConditionList<EntityCondition>(joinList, EntityOperator.AND);                
+                EntityConditionList<EntityExpr> exprList = EntityCondition.makeCondition(expressions, EntityOperator.OR);
+                EntityExpr keyExpr = EntityCondition.makeCondition(pkey, primaryKey);
+                EntityExpr partyExpr = EntityCondition.makeCondition("partyId", userLogin.getString("partyId"));
+                condition = EntityCondition.makeCondition(exprList, keyExpr, partyExpr);
             }
             
         }

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java Wed May 28 00:16:36 2008
@@ -37,6 +37,7 @@
 import org.ofbiz.entity.GenericDelegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.condition.EntityCondition;
 import org.ofbiz.entity.condition.EntityFieldMap;
 import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.entity.serialize.SerializeException;
@@ -292,7 +293,7 @@
 
         long count = 0;
         try {
-            EntityFieldMap ecl = new EntityFieldMap(UtilMisc.toMap("parentJobId", pJobId, "statusId", "SERVICE_FAILED"), EntityOperator.AND);
+            EntityFieldMap ecl = EntityCondition.makeConditionMap("parentJobId", pJobId, "statusId", "SERVICE_FAILED");
             count = delegator.findCountByCondition("JobSandbox", ecl, null, null);
         } catch (GenericEntityException e) {
             Debug.logError(e, module);

Modified: ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/ActivityIteratorCondExprBldr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/ActivityIteratorCondExprBldr.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/ActivityIteratorCondExprBldr.java (original)
+++ ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/ActivityIteratorCondExprBldr.java Wed May 28 00:16:36 2008
@@ -66,25 +66,25 @@
 
     public ActivityIteratorExpressionBuilder addPackageIdEquals(String s) {
         this.addProcess(org.ofbiz.shark.SharkConstants.packageId, org.ofbiz.shark.SharkConstants.packageId);
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.packageId, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.packageId, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addProcessDefIdEquals(String s) {
         this.addProcess(org.ofbiz.shark.SharkConstants.definitionId, "procDefId");
-        this.addCondition(new EntityExpr("procDefId", isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition("procDefId", isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addMgrNameEquals(String s) {
         this.addProcess(org.ofbiz.shark.SharkConstants.mgrName, org.ofbiz.shark.SharkConstants.mgrName);
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.mgrName, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.mgrName, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addVersionEquals(String s) {
         this.addProcess(org.ofbiz.shark.SharkConstants.packageVer, org.ofbiz.shark.SharkConstants.packageVer);
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.packageVer, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.packageVer, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
@@ -94,42 +94,42 @@
 
     public ActivityIteratorExpressionBuilder addProcessStateEquals(String s) {
         this.addProcess(org.ofbiz.shark.SharkConstants.packageVer, org.ofbiz.shark.SharkConstants.packageVer);
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.packageVer, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.packageVer, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addProcessStateStartsWith(String s) {
         this.addProcess(org.ofbiz.shark.SharkConstants.currentState, "procState");
-        this.addCondition(new EntityExpr("procState", isNotSet ? EntityOperator.NOT_LIKE : EntityOperator.LIKE, s + "%"));
+        this.addCondition(EntityCondition.makeCondition("procState", isNotSet ? EntityOperator.NOT_LIKE : EntityOperator.LIKE, s + "%"));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addProcessIdEquals(String s) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.processId, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.processId, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addProcessNameEquals(String s) {
         this.addProcess(org.ofbiz.shark.SharkConstants.processName, org.ofbiz.shark.SharkConstants.processName);
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.processName, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.processName, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addProcessPriorityEquals(int i) {
         this.addProcess(org.ofbiz.shark.SharkConstants.priority, "procPriority");
-        this.addCondition(new EntityExpr("procPriority", isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Long(i)));
+        this.addCondition(EntityCondition.makeCondition("procPriority", isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Long(i)));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addProcessDescriptionEquals(String s) {
         this.addProcess(org.ofbiz.shark.SharkConstants.description, "procDesc");
-        this.addCondition(new EntityExpr("procDesc", isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition("procDesc", isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addProcessDescriptionContains(String s) {
         this.addProcess(org.ofbiz.shark.SharkConstants.description, "procDesc");
-        this.addCondition(new EntityExpr("procDesc", isNotSet ? EntityOperator.NOT_LIKE : EntityOperator.LIKE, "%" + s + "%"));
+        this.addCondition(EntityCondition.makeCondition("procDesc", isNotSet ? EntityOperator.NOT_LIKE : EntityOperator.LIKE, "%" + s + "%"));
         return this;
     }
 
@@ -196,82 +196,82 @@
     // WfActivity Conditions
 
     public ActivityIteratorExpressionBuilder addStateEquals(String s) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.currentState, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.currentState, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addStateStartsWith(String s) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.currentState, isNotSet ? EntityOperator.NOT_LIKE : EntityOperator.LIKE, s + "%"));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.currentState, isNotSet ? EntityOperator.NOT_LIKE : EntityOperator.LIKE, s + "%"));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addIdEquals(String s) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.activityId, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.activityId, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addNameEquals(String s) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.activityName, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.activityName, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addPriorityEquals(int i) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.priority, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Long(i)));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.priority, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Long(i)));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addDescriptionEquals(String s) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.description, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.description, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addDescriptionContains(String s) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.description, isNotSet ? EntityOperator.NOT_LIKE : EntityOperator.LIKE, "%" + s + "%"));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.description, isNotSet ? EntityOperator.NOT_LIKE : EntityOperator.LIKE, "%" + s + "%"));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addActivatedTimeEquals(long l) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.activatedTime, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Timestamp(l)));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.activatedTime, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Timestamp(l)));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addActivatedTimeBefore(long l) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.activatedTime, isNotSet ? EntityOperator.LESS_THAN : EntityOperator.GREATER_THAN_EQUAL_TO, new Timestamp(l)));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.activatedTime, isNotSet ? EntityOperator.LESS_THAN : EntityOperator.GREATER_THAN_EQUAL_TO, new Timestamp(l)));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addActivatedTimeAfter(long l) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.activatedTime, isNotSet ? EntityOperator.GREATER_THAN : EntityOperator.LESS_THAN_EQUAL_TO, new Timestamp(l)));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.activatedTime, isNotSet ? EntityOperator.GREATER_THAN : EntityOperator.LESS_THAN_EQUAL_TO, new Timestamp(l)));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addLastStateTimeEquals(long l) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.lastStateTime, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Timestamp(l)));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.lastStateTime, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Timestamp(l)));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addLastStateTimeBefore(long l) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.lastStateTime, isNotSet ? EntityOperator.LESS_THAN : EntityOperator.GREATER_THAN_EQUAL_TO, new Timestamp(l)));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.lastStateTime, isNotSet ? EntityOperator.LESS_THAN : EntityOperator.GREATER_THAN_EQUAL_TO, new Timestamp(l)));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addLastStateTimeAfter(long l) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.lastStateTime, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Timestamp(l)));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.lastStateTime, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Timestamp(l)));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addAcceptedTimeEquals(long l) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.acceptedTime, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Timestamp(l)));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.acceptedTime, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Timestamp(l)));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addAcceptedTimeBefore(long l) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.acceptedTime, isNotSet ? EntityOperator.LESS_THAN : EntityOperator.GREATER_THAN_EQUAL_TO, new Timestamp(l)));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.acceptedTime, isNotSet ? EntityOperator.LESS_THAN : EntityOperator.GREATER_THAN_EQUAL_TO, new Timestamp(l)));
         return this;
     }
 
     public ActivityIteratorExpressionBuilder addAcceptedTimeAfter(long l) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.acceptedTime, isNotSet ? EntityOperator.GREATER_THAN : EntityOperator.LESS_THAN_EQUAL_TO, new Timestamp(l)));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.acceptedTime, isNotSet ? EntityOperator.GREATER_THAN : EntityOperator.LESS_THAN_EQUAL_TO, new Timestamp(l)));
         return this;
     }
 

Modified: ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/BaseEntityCondExprBldr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/BaseEntityCondExprBldr.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/BaseEntityCondExprBldr.java (original)
+++ ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/BaseEntityCondExprBldr.java Wed May 28 00:16:36 2008
@@ -115,9 +115,9 @@
         } else {
             List condList = UtilMisc.toList(condition, current);
             if (this.isOrSet) {
-                condition = new EntityConditionList(condList, EntityOperator.OR);
+                condition = EntityCondition.makeCondition(condList, EntityOperator.OR);
             } else {
-                condition = new EntityConditionList(condList, EntityOperator.AND);
+                condition = EntityCondition.makeCondition(condList, EntityOperator.AND);
             }
         }
         // reset the NOT value

Modified: ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/ProcessMgrIteratorCondExprBldr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/ProcessMgrIteratorCondExprBldr.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/ProcessMgrIteratorCondExprBldr.java (original)
+++ ofbiz/trunk/framework/shark/src/org/ofbiz/shark/expression/ProcessMgrIteratorCondExprBldr.java Wed May 28 00:16:36 2008
@@ -51,27 +51,27 @@
     }
 
     public ProcessMgrIteratorExpressionBuilder addPackageIdEquals(String s) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.packageId, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.packageId, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ProcessMgrIteratorExpressionBuilder addProcessDefIdEquals(String s) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.definitionId, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.definitionId, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ProcessMgrIteratorExpressionBuilder addNameEquals(String s) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.mgrName, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.mgrName, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ProcessMgrIteratorExpressionBuilder addVersionEquals(String s) {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.packageVer, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.packageVer, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, s));
         return this;
     }
 
     public ProcessMgrIteratorExpressionBuilder addIsEnabled() {
-        this.addCondition(new EntityExpr(org.ofbiz.shark.SharkConstants.currentState, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Long(0)));
+        this.addCondition(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.currentState, isNotSet ? EntityOperator.NOT_EQUAL : EntityOperator.EQUALS, new Long(0)));
         return this;
     }
 

Modified: ofbiz/trunk/framework/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java (original)
+++ ofbiz/trunk/framework/shark/src/org/ofbiz/shark/instance/EntityPersistentMgr.java Wed May 28 00:16:36 2008
@@ -768,14 +768,14 @@
     }
 
     public List getAllDeadlinesForProcess(String procId, SharkTransaction trans) throws PersistenceException {
-        List lookupList = getDeadlineValues(UtilMisc.toList(new EntityExpr(org.ofbiz.shark.SharkConstants.processId, EntityOperator.EQUALS, procId)));
+        List lookupList = getDeadlineValues(UtilMisc.toList(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.processId, EntityOperator.EQUALS, procId)));
         List dl = getDealineObjects(lookupList); 
         return dl;
     }
 
     public List getAllDeadlinesForProcess(String procId, long timeLimit, SharkTransaction trans) throws PersistenceException {
-        List lookupList = getDeadlineValues(UtilMisc.toList(new EntityExpr(org.ofbiz.shark.SharkConstants.processId, EntityOperator.EQUALS, procId),
-                new EntityExpr(org.ofbiz.shark.SharkConstants.timeLimit, EntityOperator.LESS_THAN, new Long(timeLimit))));
+        List lookupList = getDeadlineValues(UtilMisc.toList(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.processId, EntityOperator.EQUALS, procId),
+                EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.timeLimit, EntityOperator.LESS_THAN, new Long(timeLimit))));
         List dl = getDealineObjects(lookupList); 
         return dl;
     }
@@ -796,14 +796,14 @@
 
         EntityListIterator eli = null;
         try {
-            EntityCondition procState = new EntityExpr("processState", EntityOperator.EQUALS, "open.running");
-            EntityCondition actState1 = new EntityExpr("activityState", EntityOperator.EQUALS, "open.not_running.not_started");
-            EntityCondition actState2 = new EntityExpr("activityState", EntityOperator.EQUALS, "open.running");
+            EntityCondition procState = EntityCondition.makeCondition("processState", EntityOperator.EQUALS, "open.running");
+            EntityCondition actState1 = EntityCondition.makeCondition("activityState", EntityOperator.EQUALS, "open.not_running.not_started");
+            EntityCondition actState2 = EntityCondition.makeCondition("activityState", EntityOperator.EQUALS, "open.running");
 
-            EntityCondition actState = new EntityConditionList(UtilMisc.toList(actState1, actState2), EntityOperator.OR);
-            EntityCondition timeCond = new EntityExpr(org.ofbiz.shark.SharkConstants.timeLimit, EntityOperator.LESS_THAN, new Long(l));
+            EntityCondition actState = EntityCondition.makeCondition(UtilMisc.toList(actState1, actState2), EntityOperator.OR);
+            EntityCondition timeCond = EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.timeLimit, EntityOperator.LESS_THAN, new Long(l));
 
-            EntityCondition cond = new EntityConditionList(UtilMisc.toList(timeCond, procState, actState), EntityOperator.AND);
+            EntityCondition cond = EntityCondition.makeCondition(UtilMisc.toList(timeCond, procState, actState), EntityOperator.AND);
             eli = delegator.findListIteratorByCondition(view, cond, null, null, null, null);
             GenericValue v = null;
             while ((v = (GenericValue) eli.next()) != null) {
@@ -825,8 +825,8 @@
 
     public List getAllDeadlinesForActivity(String procId, String actId, SharkTransaction trans) throws PersistenceException {
 
-        List lookupList = getDeadlineValues(UtilMisc.toList(new EntityExpr(org.ofbiz.shark.SharkConstants.processId, EntityOperator.EQUALS, procId),
-                new EntityExpr(org.ofbiz.shark.SharkConstants.activityId, EntityOperator.EQUALS, actId)));
+        List lookupList = getDeadlineValues(UtilMisc.toList(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.processId, EntityOperator.EQUALS, procId),
+                EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.activityId, EntityOperator.EQUALS, actId)));
         List dl = getDealineObjects(lookupList); 
 
         return dl;
@@ -834,9 +834,9 @@
 
     public List getAllDeadlinesForActivity(String procId, String actId, long timeLimit, SharkTransaction trans) throws PersistenceException {
 
-        List lookupList = getDeadlineValues(UtilMisc.toList(new EntityExpr(org.ofbiz.shark.SharkConstants.processId, EntityOperator.EQUALS, procId),
-                new EntityExpr(org.ofbiz.shark.SharkConstants.activityId, EntityOperator.EQUALS, actId),
-                new EntityExpr(org.ofbiz.shark.SharkConstants.timeLimit, EntityOperator.LESS_THAN, new Long(timeLimit))));
+        List lookupList = getDeadlineValues(UtilMisc.toList(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.processId, EntityOperator.EQUALS, procId),
+                EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.activityId, EntityOperator.EQUALS, actId),
+                EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.timeLimit, EntityOperator.LESS_THAN, new Long(timeLimit))));
         List dl = getDealineObjects(lookupList); 
         return dl;
     }
@@ -876,7 +876,7 @@
             lookupList = new ArrayList();
         } else {
             try {
-                EntityConditionList ecl = new EntityConditionList(exprList, EntityOperator.AND);
+                EntityConditionList ecl = EntityCondition.makeCondition(exprList, EntityOperator.AND);
                 lookupList = delegator.findList(org.ofbiz.shark.SharkConstants.WfDeadline, ecl, null, null, null, false);
             } catch (GenericEntityException e) {
                 throw new PersistenceException(e);
@@ -1091,11 +1091,11 @@
                 List exprs = new LinkedList();
                 Iterator i = states.iterator();
                 while (i.hasNext()) {
-                    exprs.add(new EntityExpr(field, operator, i.next()));
+                    exprs.add(EntityCondition.makeCondition(field, operator, i.next()));
                 }
-                return new EntityConditionList(exprs, jop);
+                return EntityCondition.makeCondition(exprs, jop);
             } else {
-                return new EntityExpr(field, operator, states.get(0));
+                return EntityCondition.makeCondition(field, operator, states.get(0));
             }
         } else {
             throw new GenericEntityException("Cannot create entity condition from list :" + states);
@@ -1105,25 +1105,25 @@
         EntityCondition newCond = null;
         List exprs = new LinkedList();
         if (packageId != null) {
-            exprs.add(new EntityExpr(org.ofbiz.shark.SharkConstants.packageId, EntityOperator.EQUALS, packageId));
+            exprs.add(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.packageId, EntityOperator.EQUALS, packageId));
         }
         if (processDefId != null) {
-            exprs.add(new EntityExpr(org.ofbiz.shark.SharkConstants.definitionId, EntityOperator.EQUALS, processDefId));
+            exprs.add(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.definitionId, EntityOperator.EQUALS, processDefId));
         }
         if (packageVer != null) {
-            exprs.add(new EntityExpr(org.ofbiz.shark.SharkConstants.packageVer, EntityOperator.EQUALS, packageVer));
+            exprs.add(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.packageVer, EntityOperator.EQUALS, packageVer));
         }
         if (finishBefore != null) {
-            exprs.add(new EntityExpr(org.ofbiz.shark.SharkConstants.lastStateTime, EntityOperator.LESS_THAN, finishBefore));
+            exprs.add(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.lastStateTime, EntityOperator.LESS_THAN, finishBefore));
         }
 
         if (exprs.size() > 0) {
-            newCond = new EntityConditionList(exprs, EntityJoinOperator.AND);
+            newCond = EntityCondition.makeCondition(exprs, EntityJoinOperator.AND);
         }
 
         if (newCond != null) {
             if (cond != null) {
-                return new EntityConditionList(UtilMisc.toList(cond, newCond), EntityJoinOperator.AND);
+                return EntityCondition.makeCondition(UtilMisc.toList(cond, newCond), EntityJoinOperator.AND);
             } else {
                 return newCond;
             }
@@ -1138,11 +1138,11 @@
         List lookupList = null;
         try {
             EntityCondition cond = null;
-            EntityCondition proc = new EntityExpr(org.ofbiz.shark.SharkConstants.processId, EntityOperator.EQUALS, processId);
+            EntityCondition proc = EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.processId, EntityOperator.EQUALS, processId);
 
             if (states != null) {
                 EntityCondition stateCond = this.makeStateListCondition(org.ofbiz.shark.SharkConstants.currentState, states, operator, EntityOperator.OR);
-                cond = new EntityConditionList(UtilMisc.toList(proc, stateCond), EntityOperator.AND);
+                cond = EntityCondition.makeCondition(UtilMisc.toList(proc, stateCond), EntityOperator.AND);
             } else {
                 cond = proc;
             }

Modified: ofbiz/trunk/framework/shark/src/org/ofbiz/shark/repository/EntityRepositoryMgr.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/shark/src/org/ofbiz/shark/repository/EntityRepositoryMgr.java?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/shark/src/org/ofbiz/shark/repository/EntityRepositoryMgr.java (original)
+++ ofbiz/trunk/framework/shark/src/org/ofbiz/shark/repository/EntityRepositoryMgr.java Wed May 28 00:16:36 2008
@@ -296,16 +296,16 @@
         GenericDelegator delegator = SharkContainer.getDelegator();
         List exprList = new ArrayList();
         if (xpdlId != null) {
-            exprList.add(new EntityExpr(org.ofbiz.shark.SharkConstants.xpdlId, EntityOperator.EQUALS, xpdlId));
+            exprList.add(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.xpdlId, EntityOperator.EQUALS, xpdlId));
         }
         if (xpdlVersion != null) {
-            exprList.add(new EntityExpr(org.ofbiz.shark.SharkConstants.xpdlVersion, EntityOperator.EQUALS, xpdlVersion));
+            exprList.add(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.xpdlVersion, EntityOperator.EQUALS, xpdlVersion));
         }
         if (!includeHistory) {
-            exprList.add(new EntityExpr(org.ofbiz.shark.SharkConstants.isHistorical, EntityOperator.NOT_EQUAL, "Y"));
+            exprList.add(EntityCondition.makeCondition(org.ofbiz.shark.SharkConstants.isHistorical, EntityOperator.NOT_EQUAL, "Y"));
         }
 
-        EntityCondition cond = new EntityConditionList(exprList, EntityOperator.AND);
+        EntityCondition cond = EntityCondition.makeCondition(exprList, EntityOperator.AND);
         List lookupList = null;
         try {
             lookupList = delegator.findByCondition(org.ofbiz.shark.SharkConstants.WfRepository, cond, null, UtilMisc.toList("-xpdlVersion"));

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.bsh?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.bsh (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.bsh Wed May 28 00:16:36 2008
@@ -118,7 +118,7 @@
 List resultPartialList = null;
 
 if ("true".equals(find)) {
-    //EntityCondition condition = new EntityFieldMap(findByEntity, EntityOperator.AND);
+    //EntityCondition condition = EntityCondition.makeCondition(findByEntity, EntityOperator.AND);
     
     // small variation to support LIKE if a wildcard (%) is found in a String
     conditionList = FastList.newInstance();
@@ -127,12 +127,12 @@
     while (fbksIter.hasNext()) {
         findByKey = fbksIter.next();
         if (findByEntity.getString(findByKey).indexOf("%") >= 0) {
-            conditionList.add(new EntityExpr(findByKey, EntityOperator.LIKE, findByEntity.getString(findByKey)));
+            conditionList.add(EntityCondition.makeCondition(findByKey, EntityOperator.LIKE, findByEntity.getString(findByKey)));
         } else {
-            conditionList.add(new EntityExpr(findByKey, EntityOperator.EQUALS, findByEntity.get(findByKey)));
+            conditionList.add(EntityCondition.makeCondition(findByKey, EntityOperator.EQUALS, findByEntity.get(findByKey)));
         }
     }
-    condition = new EntityConditionList(conditionList, EntityOperator.AND);
+    condition = EntityCondition.makeCondition(conditionList, EntityOperator.AND);
     
     arraySize = (int) delegator.findCountByCondition(entityName, condition, null, null);
     if (arraySize < highIndex) {

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/xmldsdump.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/xmldsdump.bsh?rev=660840&r1=660839&r2=660840&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/xmldsdump.bsh (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/xmldsdump.bsh Wed May 28 00:16:36 2008
@@ -171,13 +171,13 @@
 EntityExpr entityThruCond = null;
 EntityExpr entityDateCond = null;
 if (UtilValidate.isNotEmpty(entityFrom)) {
-    entityFromCond = new EntityExpr("lastUpdatedTxStamp", EntityComparisonOperator.GREATER_THAN, entityFrom);
+    entityFromCond = EntityCondition.makeCondition("lastUpdatedTxStamp", EntityComparisonOperator.GREATER_THAN, entityFrom);
 }
 if (UtilValidate.isNotEmpty(entityThru)) {
-    entityThruCond = new EntityExpr("lastUpdatedTxStamp", EntityComparisonOperator.LESS_THAN, entityThru);
+    entityThruCond = EntityCondition.makeCondition("lastUpdatedTxStamp", EntityComparisonOperator.LESS_THAN, entityThru);
 }
 if ((entityFromCond!=null) && (entityThruCond!=null)) {
-    entityDateCond = new EntityExpr(entityFromCond, EntityJoinOperator.AND, entityThruCond);
+    entityDateCond = EntityCondition.makeCondition(entityFromCond, EntityJoinOperator.AND, entityThruCond);
 } else if(entityFromCond!=null) {
     entityDateCond = entityFromCond;
 } else if(entityThruCond!=null) {