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/24 11:56:43 UTC

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

Author: lektran
Date: Fri Oct 24 09:56:43 2014
New Revision: 1634039

URL: http://svn.apache.org/r1634039
Log:
Add filterByDate(Date) method

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=1634039&r1=1634038&r2=1634039&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 Fri Oct 24 09:56:43 2014
@@ -21,6 +21,7 @@ package org.ofbiz.entity.util;
 import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -332,6 +333,16 @@ public class EntityQuery {
         return this;
     }
 
+    /** Specifies whether the query should return only values that are active during the specified moment using from/thruDate fields.
+     * 
+     * @param moment - Date representing the moment in time that the values should be active during
+     * @return this EntityQuery object, to enable chaining
+     */
+    public EntityQuery filterByDate(Date moment) {
+        this.filterByDate(new java.sql.Timestamp(moment.getTime()));
+        return this;
+    }
+
     /** Specifies whether the query should return only values that are currently active using the specified from/thru field name pairs.
      * 
      * @param fromThruFieldName - String pairs representing the from/thru date field names e.g. "fromDate", "thruDate", "contactFromDate", "contactThruDate"