svn commit: r950765 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityJoinOperator.java

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

svn commit: r950765 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityJoinOperator.java

doogie-3
Author: doogie
Date: Wed Jun  2 21:24:07 2010
New Revision: 950765

URL: http://svn.apache.org/viewvc?rev=950765&view=rev
Log:
Refactor the 2 arg version of the addSqlValue method, to use the List
version.

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityJoinOperator.java

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=950765&r1=950764&r2=950765&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 Jun  2 21:24:07 2010
@@ -24,6 +24,8 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import javolution.util.FastList;
+
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntity;
@@ -46,17 +48,10 @@ public class EntityJoinOperator extends
 
     @Override
     public void addSqlValue(StringBuilder sql, ModelEntity modelEntity, List<EntityConditionParam> entityConditionParams, boolean compat, EntityCondition lhs, EntityCondition rhs, DatasourceInfo datasourceInfo) {
-        sql.append('(');
-        sql.append(lhs.makeWhereString(modelEntity, entityConditionParams, datasourceInfo));
-        sql.append(' ');
-        sql.append(getCode());
-        sql.append(' ');
-        if (rhs instanceof EntityCondition) {
-            sql.append(rhs.makeWhereString(modelEntity, entityConditionParams, datasourceInfo));
-        } else {
-            addValue(sql, null, rhs, entityConditionParams);
-        }
-        sql.append(')');
+        List<EntityCondition> conditions = FastList.newInstance();
+        conditions.add(lhs);
+        conditions.add(rhs);
+        addSqlValue(sql, modelEntity, entityConditionParams, conditions, datasourceInfo);
     }
 
     public void addSqlValue(StringBuilder sql, ModelEntity modelEntity, List<EntityConditionParam> entityConditionParams, List<? extends EntityCondition> conditionList, DatasourceInfo datasourceInfo) {