svn commit: r755320 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java

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

svn commit: r755320 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityComparisonOperator.java

sichen
Author: sichen
Date: Tue Mar 17 17:00:38 2009
New Revision: 755320

URL: http://svn.apache.org/viewvc?rev=755320&view=rev
Log:
OFBIZ-1266 patch from Jeremy Wickersheimer to fix issue with IN FALSE on some queries

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

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=755320&r1=755319&r2=755320&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 Tue Mar 17 17:00:38 2009
@@ -87,9 +87,9 @@
     public void addSqlValue(StringBuilder sql, ModelEntity entity, List<EntityConditionParam> entityConditionParams, boolean compat, Object lhs, Object rhs, DatasourceInfo datasourceInfo) {
         //Debug.logInfo("EntityComparisonOperator.addSqlValue field=" + lhs + ", value=" + rhs + ", value type=" + (rhs == null ? "null object" : rhs.getClass().getName()), module);
         
-        // if this is an IN operator and the rhs Object isEmpty, add "FALSE" instead of the normal SQL
+        // if this is an IN operator and the rhs Object isEmpty, add "1=0" instead of the normal SQL.  Note that "FALSE" does not work with all databases.
         if (this.idInt == EntityOperator.ID_IN && UtilValidate.isEmpty(rhs)) {
-            sql.append("FALSE");
+            sql.append("1=0");
             return;
         }