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/05/31 00:07:23 UTC

svn commit: r949611 - in /ofbiz/trunk/framework/entity/src/org/ofbiz/entity: condition/EntityClause.java datasource/GenericDAO.java model/ModelViewEntity.java sql/EntitySelectPlan.java

Author: doogie
Date: Sun May 30 22:07:23 2010
New Revision: 949611

URL: http://svn.apache.org/viewvc?rev=949611&view=rev
Log:
Fix instances of String+String while appending to a StringBuilder/StringBuffer.

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityClause.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntitySelectPlan.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityClause.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityClause.java?rev=949611&r1=949610&r2=949611&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityClause.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityClause.java Sun May 30 22:07:23 2010
@@ -133,15 +133,15 @@ public class EntityClause {
     public String toString() {
         StringBuilder outputBuffer = new StringBuilder();
 
-        outputBuffer.append("[firstEntity," + (firstEntity == null ? "null" : firstEntity) + "]");
-        outputBuffer.append("[secondEntity," + (secondEntity == null ? "null" : secondEntity) + "]");
-        outputBuffer.append("[firstField," + (firstField == null ? "null" : firstField) + "]");
-        outputBuffer.append("[secondField," + (secondField == null ? "null" : secondField) + "]");
-        outputBuffer.append("[firstModelEntity," + (firstModelEntity == null ? "null" : (firstModelEntity.getEntityName() == null ? "null" : firstModelEntity.getEntityName())) + "]");
-        outputBuffer.append("[secondModelEntity," + (secondModelEntity == null ? "null" : (secondModelEntity.getEntityName() == null ? "null" : secondModelEntity.getEntityName())) + "]");
-        outputBuffer.append("[interFieldOperation," + (interFieldOperation == null ? "null" : (interFieldOperation.getCode() == null ? "null" : interFieldOperation.getCode())) + "]");
-        outputBuffer.append("[intraFieldOperation," + (intraFieldOperation == null ? "null" : (intraFieldOperation.getCode() == null ? "null" : intraFieldOperation.getCode())) + "]");
-        outputBuffer.append("[value," + (getValue().toString() == null ? "null" : getValue().toString()) + "]");
+        outputBuffer.append("[firstEntity,").append(firstEntity == null ? "null" : firstEntity).append("]");
+        outputBuffer.append("[secondEntity,").append(secondEntity == null ? "null" : secondEntity).append("]");
+        outputBuffer.append("[firstField,").append(firstField == null ? "null" : firstField).append("]");
+        outputBuffer.append("[secondField,").append(secondField == null ? "null" : secondField).append("]");
+        outputBuffer.append("[firstModelEntity,").append(firstModelEntity == null ? "null" : (firstModelEntity.getEntityName() == null ? "null" : firstModelEntity.getEntityName())).append("]");
+        outputBuffer.append("[secondModelEntity,").append(secondModelEntity == null ? "null" : (secondModelEntity.getEntityName() == null ? "null" : secondModelEntity.getEntityName())).append("]");
+        outputBuffer.append("[interFieldOperation,").append(interFieldOperation == null ? "null" : (interFieldOperation.getCode() == null ? "null" : interFieldOperation.getCode())).append("]");
+        outputBuffer.append("[intraFieldOperation,").append(intraFieldOperation == null ? "null" : (intraFieldOperation.getCode() == null ? "null" : intraFieldOperation.getCode())).append("]");
+        outputBuffer.append("[value,").append(getValue().toString() == null ? "null" : getValue().toString()).append("]");
         return outputBuffer.toString();
     }
 

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=949611&r1=949610&r2=949611&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 Sun May 30 22:07:23 2010
@@ -867,7 +867,7 @@ public class GenericDAO {
 
             collist.add(mf.getColName());
             fldlist.add(mf.getName());
-            selsb.append(ttable + "." + mf.getColName());
+            selsb.append(ttable).append(".").append(mf.getColName());
             if (iterator.hasNext()) {
                 selsb.append(", ");
             } else {
@@ -887,7 +887,7 @@ public class GenericDAO {
             if (wheresb.length() > 0) {
                 wheresb.append(" AND ");
             }
-            wheresb.append(atable + "." + modelEntityOne.getField(lfname).getColName() + " = " + ttable + "." + modelEntityTwo.getField(rfname).getColName());
+            wheresb.append(atable).append(".").append(modelEntityOne.getField(lfname).getColName()).append(" = ").append(ttable).append(".").append(modelEntityTwo.getField(rfname).getColName());
         }
 
         // construct the source entity qualifier
@@ -909,7 +909,7 @@ public class GenericDAO {
             if (wheresb.length() > 0) {
                 wheresb.append(" AND ");
             }
-            wheresb.append(atable + "." + lcolname + " = ? ");
+            wheresb.append(atable).append(".").append(lcolname).append(" = ? ");
         }
 
         // construct a join sql query
@@ -918,7 +918,7 @@ public class GenericDAO {
         sqlsb.append("SELECT ");
         sqlsb.append(selsb.toString());
         sqlsb.append(" FROM ");
-        sqlsb.append(atable + ", " + ttable);
+        sqlsb.append(atable).append(", ").append(ttable);
         sqlsb.append(" WHERE ");
         sqlsb.append(wheresb.toString());
         sqlsb.append(SqlJdbcUtil.makeOrderByClause(modelEntityTwo, orderBy, true, datasourceInfo));

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java?rev=949611&r1=949610&r2=949611&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java Sun May 30 22:07:23 2010
@@ -343,7 +343,7 @@ public class ModelViewEntity extends Mod
             if (alias) {
                 ModelAlias modelAlias = this.getAlias(field.name);
                 if (modelAlias != null) {
-                    returnString.append(" AS " + modelAlias.getColAlias());
+                    returnString.append(" AS ").append(modelAlias.getColAlias());
                 }
             }
             if (fldsIt.hasNext()) {

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntitySelectPlan.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntitySelectPlan.java?rev=949611&r1=949610&r2=949611&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntitySelectPlan.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/sql/EntitySelectPlan.java Sun May 30 22:07:23 2010
@@ -100,7 +100,7 @@ public final class EntitySelectPlan exte
     }
 
     public StringBuilder appendTo(StringBuilder sb) {
-        sb.append("dve=" + dve);
+        sb.append("dve=").append(dve);
         if (getWherePlan() != null) {
             if (sb.length() > 0) sb.append(", ");
             sb.append("where=(");