You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by le...@apache.org on 2014/10/15 09:35:25 UTC

svn commit: r1631963 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityQuery.java

Author: lektran
Date: Wed Oct 15 07:35:24 2014
New Revision: 1631963

URL: http://svn.apache.org/r1631963
Log:
Improve filterByDate(Timestamp) to not filter by date when the passed in Timestamp is null.  Better mimics the behavior of EntityUtil.filterByDate(Timestamp)

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityQuery.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityQuery.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityQuery.java?rev=1631963&r1=1631962&r2=1631963&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityQuery.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityQuery.java Wed Oct 15 07:35:24 2014
@@ -319,9 +319,16 @@ public class EntityQuery {
      * @return this EntityQuery object, to enable chaining
      */
     public EntityQuery filterByDate(Timestamp moment) {
-        this.filterByDate = true;
-        this.filterByDateMoment = moment;
-        this.filterByFieldNames = null;
+        if (moment != null) {
+            this.filterByDate = true;
+            this.filterByDateMoment = moment;
+            this.filterByFieldNames = null;
+        } else {
+            // Maintain existing behavior exhibited by EntityUtil.filterByDate(moment) when moment is null and perform no date filtering
+            this.filterByDate = false;
+            this.filterByDateMoment = null;
+            this.filterByFieldNames = null;
+        }
         return this;
     }