Author: lektran
Date: Wed Oct 15 07:35:24 2014
New Revision: 1631963
URL:
http://svn.apache.org/r1631963Log:
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;
}