You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2009/11/23 23:24:59 UTC

svn commit: r883525 - /ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java

Author: hansbak
Date: Mon Nov 23 22:24:59 2009
New Revision: 883525

URL: http://svn.apache.org/viewvc?rev=883525&view=rev
Log:
fix for using equals operator with null field in performFind service:   OFBIZ-3151

Modified:
    ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java

Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java?rev=883525&r1=883524&r2=883525&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java (original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java Mon Nov 23 22:24:59 2009
@@ -301,10 +301,13 @@
             if (ignoreCase != null && ignoreCase.equals("Y") && "java.lang.String".equals(fieldObject.getClass().getName())) {
                 cond = EntityCondition.makeCondition(EntityFunction.UPPER_FIELD(fieldName), (EntityComparisonOperator) fieldOp, EntityFunction.UPPER(((String)fieldValue).toUpperCase()));
             } else {
+                if (fieldObject.equals(GenericEntity.NULL_FIELD.toString())) {
+                    fieldObject = null;
+                }
                 cond = EntityCondition.makeCondition(fieldName, (EntityComparisonOperator) fieldOp, fieldObject);
             }
             
-            if (EntityOperator.NOT_EQUAL.equals(fieldOp) && !fieldObject.equals(GenericEntity.NULL_FIELD.toString())) {
+            if (EntityOperator.NOT_EQUAL.equals(fieldOp) && fieldObject != null) {
                 tmpOrList = FastList.newInstance();
                 tmpOrList.add(cond);
                 nullCond = EntityCondition.makeCondition(fieldName, null);