You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by sa...@apache.org on 2011/03/08 19:09:47 UTC

svn commit: r1079456 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java

Author: sascharodekamp
Date: Tue Mar  8 18:09:47 2011
New Revision: 1079456

URL: http://svn.apache.org/viewvc?rev=1079456&view=rev
Log:
Improvement - Added a new method: getRelatedByAndCache because there is only a methode getRelatedByAnd which uses no cache.

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

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java?rev=1079456&r1=1079455&r2=1079456&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java Tue Mar  8 18:09:47 2011
@@ -369,6 +369,16 @@ public class EntityUtil {
         return result;
     }
 
+    public static List<GenericValue> getRelatedByAndCache(String relationName, Map<String, ? extends Object> fields, List<GenericValue> values) throws GenericEntityException {
+        if (values == null) return null;
+
+        List<GenericValue> result = FastList.newInstance();
+        for (GenericValue value: values) {
+            result.addAll(value.getRelatedByAndCache(relationName, fields));
+        }
+        return result;
+    }
+
     public static <T extends GenericEntity> List<T> filterByCondition(List<T> values, EntityCondition condition) {
         if (values == null) return null;