diff --git a/framework/common/src/org/ofbiz/common/geo/GeoWorker.java b/framework/common/src/org/ofbiz/common/geo/GeoWorker.java index 78bb267037..46fd1e31cd 100644 --- a/framework/common/src/org/ofbiz/common/geo/GeoWorker.java +++ b/framework/common/src/org/ofbiz/common/geo/GeoWorker.java @@ -62,7 +62,7 @@ public class GeoWorker { List geoList = FastList.newInstance(); List thisGeoAssoc = null; try { - thisGeoAssoc = geo.getRelated("AssocGeoAssoc", UtilMisc.toMap("geoAssocTypeId", "GROUP_MEMBER"), null); + thisGeoAssoc = geo.getRelated("AssocGeoAssoc", UtilMisc.toMap("geoAssocTypeId", "GROUP_MEMBER"), null, false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get associated Geo GROUP_MEMBER relationship(s)", module); } diff --git a/framework/entity/src/org/ofbiz/entity/GenericValue.java b/framework/entity/src/org/ofbiz/entity/GenericValue.java index 279c4c2177..ab1160c3f7 100644 --- a/framework/entity/src/org/ofbiz/entity/GenericValue.java +++ b/framework/entity/src/org/ofbiz/entity/GenericValue.java @@ -274,7 +274,7 @@ public class GenericValue extends GenericEntity implements Reusable { List col = relatedCache.get(relationName); if (col == null) { - col = getRelated(relationName); + col = getRelated(relationName, null, null, false); relatedCache.put(relationName, col); } return col; diff --git a/framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java b/framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java index 55333a9933..2acf4c35ad 100644 --- a/framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java +++ b/framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java @@ -86,7 +86,7 @@ public class EntityTypeUtil { // first get all childrenTypes ... List childrenTypes = null; try { - childrenTypes = typeValue.getRelatedCache("Child" + typeValue.getEntityName()); + childrenTypes = typeValue.getRelated("Child" + typeValue.getEntityName(), null, null, true); } catch (GenericEntityException e) { Debug.logWarning(e, module); return null; diff --git a/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java b/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java index 0f53efe716..59f30c8f92 100644 --- a/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java +++ b/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java @@ -344,7 +344,7 @@ public class EntityUtil { List result = FastList.newInstance(); for (GenericValue value: values) { - result.addAll(value.getRelated(relationName)); + result.addAll(value.getRelated(relationName, null, null, false)); } return result; } @@ -354,7 +354,7 @@ public class EntityUtil { List result = FastList.newInstance(); for (GenericValue value: values) { - result.addAll(value.getRelatedCache(relationName)); + result.addAll(value.getRelated(relationName, null, null, true)); } return result; } diff --git a/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java b/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java index 5332d40f72..7e4437fe6a 100644 --- a/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java +++ b/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java @@ -778,7 +778,7 @@ public class EntityPermissionChecker { List purposes = null; try { - purposes = entity.getRelatedCache(entityName + "Purpose"); + purposes = entity.getRelated(entityName + "Purpose", null, null, true); } catch (GenericEntityException e) { Debug.logError(e, "No associated purposes found. ", module); return purposeIds; @@ -820,7 +820,7 @@ public class EntityPermissionChecker { String partyId = (String)userLogin.get("partyId"); List relatedRoles = null; - List tmpRelatedRoles = entity.getRelatedCache(entityName + "Role"); + List tmpRelatedRoles = entity.getRelated(entityName + "Role", null, null, true); relatedRoles = EntityUtil.filterByDate(tmpRelatedRoles); if (relatedRoles != null) { for (GenericValue contentRole: relatedRoles) { diff --git a/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java b/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java index d86c11fb83..76bcab1a31 100644 --- a/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java +++ b/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java @@ -847,9 +847,9 @@ public class EntitySyncContext { /** prepare a list of all entities we want to synchronize: remove all view-entities and all entities that don't match the patterns attached to this EntitySync */ protected List makeEntityModelToUseList() throws GenericEntityException { - List entitySyncIncludes = entitySync.getRelated("EntitySyncInclude"); + List entitySyncIncludes = entitySync.getRelated("EntitySyncInclude", null, null, false); // get these ones as well, and just add them to the main list, it will have an extra field but that shouldn't hurt anything in the code below - List entitySyncGroupIncludes = entitySync.getRelated("EntitySyncInclGrpDetailView"); + List entitySyncGroupIncludes = entitySync.getRelated("EntitySyncInclGrpDetailView", null, null, false); entitySyncIncludes.addAll(entitySyncGroupIncludes); List entityModelToUseList = EntityGroupUtil.getModelEntitiesFromRecords(entitySyncIncludes, delegator, true); diff --git a/framework/minilang/src/org/ofbiz/minilang/method/entityops/GetRelated.java b/framework/minilang/src/org/ofbiz/minilang/method/entityops/GetRelated.java index 0acb67d3d5..d4dcfa0b20 100644 --- a/framework/minilang/src/org/ofbiz/minilang/method/entityops/GetRelated.java +++ b/framework/minilang/src/org/ofbiz/minilang/method/entityops/GetRelated.java @@ -75,11 +75,7 @@ public class GetRelated extends MethodOperation { return true; } try { - if (useCache) { - listAcsr.put(methodContext, value.getRelatedCache(relationName, constraintMap, orderByNames)); - } else { - listAcsr.put(methodContext, value.getRelated(relationName, constraintMap, orderByNames)); - } + listAcsr.put(methodContext, value.getRelated(relationName, constraintMap, orderByNames, useCache)); } catch (GenericEntityException e) { String errMsg = "ERROR: Could not complete the " + simpleMethod.getShortDescription() + " process [problem getting related from entity with name " + value.getEntityName() + " for the relation-name: " + relationName + ": " + e.getMessage() + "]"; Debug.logError(e, errMsg, module); diff --git a/framework/service/src/org/ofbiz/service/calendar/RecurrenceInfo.java b/framework/service/src/org/ofbiz/service/calendar/RecurrenceInfo.java index 6fd70b651c..67c8f651c9 100644 --- a/framework/service/src/org/ofbiz/service/calendar/RecurrenceInfo.java +++ b/framework/service/src/org/ofbiz/service/calendar/RecurrenceInfo.java @@ -76,7 +76,7 @@ public class RecurrenceInfo { // Get the recurrence rules objects try { rRulesList = new ArrayList(); - for (GenericValue value: info.getRelated("RecurrenceRule")) { + for (GenericValue value: info.getRelated("RecurrenceRule", null, null, false)) { rRulesList.add(new RecurrenceRule(value)); } } catch (GenericEntityException gee) { @@ -88,7 +88,7 @@ public class RecurrenceInfo { // Get the exception rules objects try { eRulesList = new ArrayList(); - for (GenericValue value: info.getRelated("ExceptionRecurrenceRule")) { + for (GenericValue value: info.getRelated("ExceptionRecurrenceRule", null, null, false)) { eRulesList.add(new RecurrenceRule(value)); } } catch (GenericEntityException gee) { diff --git a/framework/webtools/webapp/webtools/WEB-INF/actions/entity/ViewGeneric.groovy b/framework/webtools/webapp/webtools/WEB-INF/actions/entity/ViewGeneric.groovy index 87226ebe72..88c577f31b 100644 --- a/framework/webtools/webapp/webtools/WEB-INF/actions/entity/ViewGeneric.groovy +++ b/framework/webtools/webapp/webtools/WEB-INF/actions/entity/ViewGeneric.groovy @@ -325,7 +325,7 @@ for (int relIndex = 0; relIndex < entity.getRelationsSize(); relIndex++) { if ("one".equals(relation.getType()) || "one-nofk".equals(relation.getType())) { if (value != null) { if (hasAllView || security.hasEntityPermission(relatedEntity.getPlainTableName(), "_VIEW", session)) { - Iterator tempIter = UtilMisc.toIterator(value.getRelated(relation.getTitle() + relatedEntity.getEntityName())); + Iterator tempIter = UtilMisc.toIterator(value.getRelated(relation.getTitle() + relatedEntity.getEntityName(), null, null, false)); GenericValue valueRelated = null; if (tempIter != null && tempIter.hasNext()) { valueRelated = (GenericValue) tempIter.next(); diff --git a/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java b/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java index 100e64c5da..285c3e4498 100644 --- a/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java +++ b/framework/widget/src/org/ofbiz/widget/ModelWidgetAction.java @@ -658,11 +658,7 @@ public abstract class ModelWidgetAction implements Serializable { constraintMap = mapAcsr.get(context); } try { - if (useCache) { - listNameAcsr.put(context, value.getRelatedCache(relationName, constraintMap, orderByNames)); - } else { - listNameAcsr.put(context, value.getRelated(relationName, constraintMap, orderByNames)); - } + listNameAcsr.put(context, value.getRelated(relationName, constraintMap, orderByNames, useCache)); } catch (GenericEntityException e) { String errMsg = "Problem getting related from entity with name " + value.getEntityName() + " for the relation-name: " + relationName + ": " + e.getMessage(); Debug.logError(e, errMsg, module); diff --git a/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java b/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java index 056ce6b025..75841cc67d 100644 --- a/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java +++ b/framework/widget/src/org/ofbiz/widget/screen/ModelScreenAction.java @@ -657,11 +657,7 @@ public abstract class ModelScreenAction implements Serializable { constraintMap = mapAcsr.get(context); } try { - if (useCache) { - listNameAcsr.put(context, value.getRelatedCache(relationName, constraintMap, orderByNames)); - } else { - listNameAcsr.put(context, value.getRelated(relationName, constraintMap, orderByNames)); - } + listNameAcsr.put(context, value.getRelated(relationName, constraintMap, orderByNames, useCache)); } catch (GenericEntityException e) { String errMsg = "Problem getting related from entity with name " + value.getEntityName() + " for the relation-name: " + relationName + ": " + e.getMessage(); Debug.logError(e, errMsg, module);