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

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

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

jleroux@apache.org
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);
             }