You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2008/11/30 21:41:56 UTC

svn commit: r721893 - /ofbiz/branches/release4.0/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java

Author: jleroux
Date: Sun Nov 30 12:41:56 2008
New Revision: 721893

URL: http://svn.apache.org/viewvc?rev=721893&view=rev
Log:
Merged by hand from 721839

Modified:
    ofbiz/branches/release4.0/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java

Modified: ofbiz/branches/release4.0/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java?rev=721893&r1=721892&r2=721893&view=diff
==============================================================================
--- ofbiz/branches/release4.0/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java (original)
+++ ofbiz/branches/release4.0/framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java Sun Nov 30 12:41:56 2008
@@ -201,8 +201,9 @@
                 throw new IllegalArgumentException("Could not find an entity operator for the name: " + operatorName);
             }
 
-            // If IN operator, see if value is a literal list and split it
-            if (operator == EntityOperator.IN && value instanceof String) {
+            // If IN or BETWEEN operator, see if value is a literal list and split it
+            if ((operator == EntityOperator.IN || operator == EntityOperator.BETWEEN)
+                    && value instanceof String) {
                 String delim = null;
                 if (((String)value).indexOf("|") >= 0) {
                     delim = "|";   
@@ -213,9 +214,10 @@
                     value = StringUtil.split((String)value, delim);   
                 }
             }
-            
-            // don't convert the field to the desired type if this is an IN operator and we have a Collection
-            if (!(operator == EntityOperator.IN && value instanceof Collection)) {
+                        
+            // don't convert the field to the desired type if this is an IN or BETWEEN operator and we have a Collection
+            if (!((operator == EntityOperator.IN || operator == EntityOperator.BETWEEN) 
+                    && value instanceof Collection)) {
                 // now to a type conversion for the target fieldName
                 value = modelEntity.convertFieldValue(fieldName, value, delegator);
             }