Author: sascharodekamp
Date: Tue Mar 8 18:09:47 2011
New Revision: 1079456
URL:
http://svn.apache.org/viewvc?rev=1079456&view=revLog:
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;