Author: doogie
Date: Mon May 14 20:59:54 2012 New Revision: 1338403 URL: http://svn.apache.org/viewvc?rev=1338403&view=rev Log: DEPRECATION: framework: findByAnd variants replaced with findByAnd that takes a boolean useCache parameter. Modified: ofbiz/trunk/framework/bi/src/org/ofbiz/bi/util/DimensionServices.java ofbiz/trunk/framework/common/src/org/ofbiz/common/KeywordSearchUtil.java ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java ofbiz/trunk/framework/common/src/org/ofbiz/common/geo/GeoWorker.java ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java ofbiz/trunk/framework/common/src/org/ofbiz/common/olap/CommonDimensionServices.java ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java ofbiz/trunk/framework/common/src/org/ofbiz/common/scripting/ScriptHelperImpl.java ofbiz/trunk/framework/common/src/org/ofbiz/common/status/StatusServices.java ofbiz/trunk/framework/common/src/org/ofbiz/common/status/StatusWorker.java ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/GetParentPortalPageId.groovy ofbiz/trunk/framework/common/webcommon/includes/listVisualThemes.ftl ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityUtil.java ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/EntityAuthorization.java ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyBaseScript.groovy ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/workflow/WorkflowMonitor.groovy ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java Modified: ofbiz/trunk/framework/bi/src/org/ofbiz/bi/util/DimensionServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/bi/src/org/ofbiz/bi/util/DimensionServices.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/bi/src/org/ofbiz/bi/util/DimensionServices.java (original) +++ ofbiz/trunk/framework/bi/src/org/ofbiz/bi/util/DimensionServices.java Mon May 14 20:59:54 2012 @@ -48,7 +48,7 @@ public class DimensionServices { GenericValue lastDimensionValue = null; try { // TODO: improve performance - lastDimensionValue = EntityUtil.getFirst(delegator.findByAnd(dimensionEntityName, naturalKeyFields, UtilMisc.toList("-createdTxStamp"))); + lastDimensionValue = EntityUtil.getFirst(delegator.findByAnd(dimensionEntityName, UtilMisc.toMap(naturalKeyFields), UtilMisc.toList("-createdTxStamp"), false)); } catch (GenericEntityException gee) { return ServiceUtil.returnError(gee.getMessage()); } @@ -75,7 +75,7 @@ public class DimensionServices { } List<GenericValue> existingDimensionValues = null; try { - existingDimensionValues = delegator.findByAnd(dimensionValue.getEntityName(), andCondition); + existingDimensionValues = delegator.findByAnd(dimensionValue.getEntityName(), UtilMisc.toMap(andCondition), null, false); } catch (GenericEntityException gee) { return ServiceUtil.returnError(gee.getMessage()); } Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/KeywordSearchUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/KeywordSearchUtil.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/KeywordSearchUtil.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/KeywordSearchUtil.java Mon May 14 20:59:54 2012 @@ -218,7 +218,7 @@ public class KeywordSearchUtil { boolean replaceEnteredKeyword = false; try { - List<GenericValue> thesaurusList = delegator.findByAndCache("KeywordThesaurus", UtilMisc.toMap("enteredKeyword", enteredKeyword)); + List<GenericValue> thesaurusList = delegator.findByAnd("KeywordThesaurus", UtilMisc.toMap("enteredKeyword", enteredKeyword), null, true); for (GenericValue keywordThesaurus: thesaurusList) { String relationshipEnumId = (String) keywordThesaurus.get("relationshipEnumId"); if (thesaurusRelsToInclude.contains(relationshipEnumId)) { Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java Mon May 14 20:59:54 2012 @@ -180,7 +180,7 @@ public class UrlServletHelper extends Co } else { // send 404 error if a URI is alias TO try { - List<GenericValue> aliasTos = delegator.findByAndCache("WebSitePathAlias", UtilMisc.toMap("webSiteId", webSiteId, "aliasTo", httpRequest.getRequestURI())); + List<GenericValue> aliasTos = delegator.findByAnd("WebSitePathAlias", UtilMisc.toMap("webSiteId", webSiteId, "aliasTo", httpRequest.getRequestURI()), null, false); if (UtilValidate.isNotEmpty(aliasTos)) { httpResponse.sendError(HttpServletResponse.SC_NOT_FOUND, "Not Found"); return; Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/geo/GeoWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/geo/GeoWorker.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/geo/GeoWorker.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/geo/GeoWorker.java Mon May 14 20:59:54 2012 @@ -91,7 +91,7 @@ public class GeoWorker { } Map<String, String> geoIdByTypeMapTemp = FastMap.newInstance(); for (Map.Entry<String, String> geoIdByTypeEntry: geoIdByTypeMapOrig.entrySet()) { - List<GenericValue> geoAssocList = delegator.findByAndCache("GeoAssoc", UtilMisc.toMap("geoIdTo", geoIdByTypeEntry.getValue(), "geoAssocTypeId", "REGIONS")); + List<GenericValue> geoAssocList = delegator.findByAnd("GeoAssoc", UtilMisc.toMap("geoIdTo", geoIdByTypeEntry.getValue(), "geoAssocTypeId", "REGIONS"), null, true); for (GenericValue geoAssoc: geoAssocList) { GenericValue newGeo = delegator.findOne("Geo", true, "geoId", geoAssoc.getString("geoId")); geoIdByTypeMapTemp.put(newGeo.getString("geoTypeId"), newGeo.getString("geoId")); @@ -127,13 +127,13 @@ public class GeoWorker { List<GenericValue> gptList = null; if (UtilValidate.isNotEmpty(secondId) && UtilValidate.isNotEmpty(secondValueId)) { try { - gptList = delegator.findByAnd(entityName, UtilMisc.toMap(mainId, mainValueId, secondId, secondValueId), UtilMisc.toList("-fromDate")); + gptList = delegator.findByAnd(entityName, UtilMisc.toMap(mainId, mainValueId, secondId, secondValueId), UtilMisc.toList("-fromDate"), false); } catch (GenericEntityException e) { Debug.logError(e, "Error while finding latest GeoPoint for " + mainId + " with Id [" + mainValueId + "] and " + secondId + " Id [" + secondValueId + "] " + e.toString(), module); } } else { try { - gptList = delegator.findByAnd(entityName, UtilMisc.toMap(mainId, mainValueId), UtilMisc.toList("-fromDate")); + gptList = delegator.findByAnd(entityName, UtilMisc.toMap(mainId, mainValueId), UtilMisc.toList("-fromDate"), false); } catch (GenericEntityException e) { Debug.logError(e, "Error while finding latest GeoPoint for " + mainId + " with Id [" + mainValueId + "] " + e.toString(), module); } Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java Mon May 14 20:59:54 2012 @@ -929,7 +929,7 @@ public class LoginServices { newPasswordHash = HashCrypt.cryptUTF8(getHashType(), null, newPassword); } try { - List<GenericValue> pwdHistList = delegator.findByAnd("UserLoginPasswordHistory", UtilMisc.toMap("userLoginId",userLogin.getString("userLoginId"),"currentPassword",newPasswordHash)); + List<GenericValue> pwdHistList = delegator.findByAnd("UserLoginPasswordHistory", UtilMisc.toMap("userLoginId",userLogin.getString("userLoginId"),"currentPassword",newPasswordHash), null, false); Debug.logInfo(" checkNewPassword pwdHistListpwdHistList " + pwdHistList.size(), module); if (pwdHistList.size() >0) { Map<String, Integer> messageMap = UtilMisc.toMap("passwordChangeHistoryLimit", passwordChangeHistoryLimit); Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/olap/CommonDimensionServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/olap/CommonDimensionServices.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/olap/CommonDimensionServices.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/olap/CommonDimensionServices.java Mon May 14 20:59:54 2012 @@ -66,7 +66,7 @@ public class CommonDimensionServices { while (currentDate.compareTo(thruDate) <= 0) { GenericValue dateValue = null; try { - dateValue = EntityUtil.getFirst(delegator.findByAnd("DateDimension", UtilMisc.toMap("dateValue", currentDate))); + dateValue = EntityUtil.getFirst(delegator.findByAnd("DateDimension", UtilMisc.toMap("dateValue", currentDate), null, false)); } catch (GenericEntityException gee) { return ServiceUtil.returnError(gee.getMessage()); } Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/preferences/PreferenceServices.java Mon May 14 20:59:54 2012 @@ -80,7 +80,7 @@ public class PreferenceServices { Map<String, Object> userPrefMap = null; try { - GenericValue preference = EntityUtil.getFirst(delegator.findByAnd("UserPreference", fieldMap)); + GenericValue preference = EntityUtil.getFirst(delegator.findByAnd("UserPreference", fieldMap, null, false)); if (preference != null) { userPrefMap = PreferenceWorker.createUserPrefMap(preference); } @@ -129,9 +129,9 @@ public class PreferenceServices { Map<String, Object> userPrefMap = null; try { Map<String, String> fieldMap = UtilMisc.toMap("userLoginId", "_NA_", "userPrefGroupTypeId", userPrefGroupTypeId); - userPrefMap = PreferenceWorker.createUserPrefMap(delegator.findByAnd("UserPreference", fieldMap)); + userPrefMap = PreferenceWorker.createUserPrefMap(delegator.findByAnd("UserPreference", fieldMap, null, false)); fieldMap.put("userLoginId", userLoginId); - userPrefMap.putAll(PreferenceWorker.createUserPrefMap(delegator.findByAnd("UserPreference", fieldMap))); + userPrefMap.putAll(PreferenceWorker.createUserPrefMap(delegator.findByAnd("UserPreference", fieldMap, null, false))); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "getPreference.readFailure", new Object[] { e.getMessage() }, locale)); @@ -276,7 +276,7 @@ public class PreferenceServices { try { Map<String, String> fieldMap = UtilMisc.toMap("userLoginId", fromUserLoginId, "userPrefGroupTypeId", userPrefGroupTypeId); - List<GenericValue> resultList = delegator.findByAnd("UserPreference", fieldMap); + List<GenericValue> resultList = delegator.findByAnd("UserPreference", fieldMap, null, false); if (resultList != null) { for (GenericValue preference: resultList) { preference.set("userLoginId", userLoginId); Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/scripting/ScriptHelperImpl.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/scripting/ScriptHelperImpl.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/scripting/ScriptHelperImpl.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/scripting/ScriptHelperImpl.java Mon May 14 20:59:54 2012 @@ -155,7 +155,7 @@ public final class ScriptHelperImpl impl public List<Map<String, Object>> findList(String entityName, Map<String, ? extends Object> fields) throws ScriptException { try { - return UtilGenerics.checkList(ctxHelper.getDelegator().findByAnd(entityName, fields)); + return UtilGenerics.checkList(ctxHelper.getDelegator().findByAnd(entityName, fields, null, false)); } catch (GenericEntityException e) { String errMsg = "Error running script " + ctxHelper.getScriptName() + ": Problem invoking the findList method: " + e.getMessage(); Debug.logWarning(e, errMsg, module); Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/status/StatusServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/status/StatusServices.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/status/StatusServices.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/status/StatusServices.java Mon May 14 20:59:54 2012 @@ -56,7 +56,7 @@ public class StatusServices { List<GenericValue> statusItems = FastList.newInstance(); for (String statusTypeId: statusTypes) { try { - List<GenericValue> myStatusItems = delegator.findByAndCache("StatusItem", UtilMisc.toMap("statusTypeId", statusTypeId), UtilMisc.toList("sequenceId")); + List<GenericValue> myStatusItems = delegator.findByAnd("StatusItem", UtilMisc.toMap("statusTypeId", statusTypeId), UtilMisc.toList("sequenceId"), true); statusItems.addAll(myStatusItems); } catch (GenericEntityException e) { Debug.logError(e, module); @@ -72,7 +72,7 @@ public class StatusServices { List<GenericValue> statusValidChangeToDetails = null; String statusId = (String) context.get("statusId"); try { - statusValidChangeToDetails = delegator.findByAndCache("StatusValidChangeToDetail", UtilMisc.toMap("statusId", statusId), UtilMisc.toList("sequenceId")); + statusValidChangeToDetails = delegator.findByAnd("StatusValidChangeToDetail", UtilMisc.toMap("statusId", statusId), UtilMisc.toList("sequenceId"), true); } catch (GenericEntityException e) { Debug.logError(e, module); } Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/status/StatusWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/status/StatusWorker.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/status/StatusWorker.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/status/StatusWorker.java Mon May 14 20:59:54 2012 @@ -41,7 +41,7 @@ public class StatusWorker { Delegator delegator = (Delegator) pageContext.getRequest().getAttribute("delegator"); try { - List<GenericValue> statusItems = delegator.findByAndCache("StatusItem", UtilMisc.toMap("statusTypeId", statusTypeId), UtilMisc.toList("sequenceId")); + List<GenericValue> statusItems = delegator.findByAnd("StatusItem", UtilMisc.toMap("statusTypeId", statusTypeId), UtilMisc.toList("sequenceId"), true); if (statusItems != null) pageContext.setAttribute(attributeName, statusItems); @@ -55,7 +55,7 @@ public class StatusWorker { List<GenericValue> statusItems = FastList.newInstance(); try { - List<GenericValue> calItems = delegator.findByAndCache("StatusItem", UtilMisc.toMap("statusTypeId", statusTypeIdOne), UtilMisc.toList("sequenceId")); + List<GenericValue> calItems = delegator.findByAnd("StatusItem", UtilMisc.toMap("statusTypeId", statusTypeIdOne), UtilMisc.toList("sequenceId"), true); if (calItems != null) statusItems.addAll(calItems); @@ -63,7 +63,7 @@ public class StatusWorker { Debug.logError(e, module); } try { - List<GenericValue> taskItems = delegator.findByAndCache("StatusItem", UtilMisc.toMap("statusTypeId", statusTypeIdTwo), UtilMisc.toList("sequenceId")); + List<GenericValue> taskItems = delegator.findByAnd("StatusItem", UtilMisc.toMap("statusTypeId", statusTypeIdTwo), UtilMisc.toList("sequenceId"), true); if (taskItems != null) statusItems.addAll(taskItems); @@ -80,7 +80,7 @@ public class StatusWorker { List<GenericValue> statusValidChangeToDetails = null; try { - statusValidChangeToDetails = delegator.findByAndCache("StatusValidChangeToDetail", UtilMisc.toMap("statusId", statusId), UtilMisc.toList("sequenceId")); + statusValidChangeToDetails = delegator.findByAnd("StatusValidChangeToDetail", UtilMisc.toMap("statusId", statusId), UtilMisc.toList("sequenceId"), true); } catch (GenericEntityException e) { Debug.logError(e, module); } Modified: ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/GetParentPortalPageId.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/GetParentPortalPageId.groovy?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/GetParentPortalPageId.groovy (original) +++ ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/GetParentPortalPageId.groovy Mon May 14 20:59:54 2012 @@ -43,7 +43,7 @@ if (userLogin && parameters.parentPortal if (portalMainPages) { portalPageId = portalMainPages.get(0).portalPageId; // check if overridden with a privat page - privatMainPages = delegator.findByAnd("PortalPage", [originalPortalPageId : portalPageId, ownerUserLoginId : userLogin.userLoginId]); + privatMainPages = delegator.findByAnd("PortalPage", [originalPortalPageId : portalPageId, ownerUserLoginId : userLogin.userLoginId], null, false); if (privatMainPages) { context.parameters.portalPageId = privatMainPages.get(0).portalPageId; } else { Modified: ofbiz/trunk/framework/common/webcommon/includes/listVisualThemes.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/listVisualThemes.ftl?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/includes/listVisualThemes.ftl (original) +++ ofbiz/trunk/framework/common/webcommon/includes/listVisualThemes.ftl Mon May 14 20:59:54 2012 @@ -58,7 +58,7 @@ margin: 1em; <#list visualThemes as visualTheme> <#assign screenshots = delegator.findByAnd("VisualThemeResource", Static["org.ofbiz.base.util.UtilMisc"].toMap( "visualThemeId", "${visualTheme.visualThemeId}", - "resourceTypeEnumId", "VT_SCREENSHOT"), orderByList)> + "resourceTypeEnumId", "VT_SCREENSHOT"), orderByList, false)> <tr<#if visualTheme.visualThemeId == visualThemeId> class="selected"</#if>> <td> <form name="SetUserPreferences_${visualTheme.visualThemeId}" method="post" action="<@ofbizUrl>setUserPreference</@ofbizUrl>"> Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Mon May 14 20:59:54 2012 @@ -1952,7 +1952,7 @@ public class GenericDelegator implements fields.put(keyMap.getRelFieldName(), value.get(keyMap.getFieldName())); } - return this.findByAnd(relation.getRelEntityName(), fields, orderBy); + return this.findByAnd(relation.getRelEntityName(), fields, orderBy, false); } /* (non-Javadoc) @@ -1998,7 +1998,7 @@ public class GenericDelegator implements fields.put(keyMap.getRelFieldName(), value.get(keyMap.getFieldName())); } - return this.findByAndCache(relation.getRelEntityName(), fields, null); + return this.findByAnd(relation.getRelEntityName(), fields, null, true); } /* (non-Javadoc) @@ -2547,7 +2547,7 @@ public class GenericDelegator implements } // get values in whatever order, we will go through all of them to find the highest value - List<GenericValue> allValues = this.findByAnd(value.getEntityName(), lookupValue, null); + List<GenericValue> allValues = this.findByAnd(value.getEntityName(), lookupValue, null, false); //Debug.logInfo("Get existing values from entity " + value.getEntityName() + " with lookupValue: " + lookupValue + ", and the seqFieldName: " + seqFieldName + ", and the results are: " + allValues, module); Integer highestSeqVal = null; for (GenericValue curValue: allValues) { Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/datasource/GenericDAO.java Mon May 14 20:59:54 2012 @@ -430,7 +430,7 @@ public class GenericDAO { List<GenericValue> meResult = null; try { - meResult = delegator.findByAnd(meName, findByMap); + meResult = delegator.findByAnd(meName, findByMap, null, false); } catch (GenericEntityException e) { throw new GenericEntityException("Error while retrieving partial results for entity member: " + meName, e); } Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java Mon May 14 20:59:54 2012 @@ -330,7 +330,7 @@ public class EntityTestSuite extends Ent EntityCondition isLevel1 = EntityCondition.makeCondition("description", EntityOperator.EQUALS, "node-level #1"); Map<String, String> fieldsToSet = UtilMisc.toMap("description", "node-level #1 (updated)"); delegator.storeByCondition("TestingNode", fieldsToSet, isLevel1); - List<GenericValue> updatedNodes = delegator.findByAnd("TestingNode", fieldsToSet); + List<GenericValue> updatedNodes = delegator.findByAnd("TestingNode", fieldsToSet, null, false); int n = updatedNodes.size(); assertTrue("testStoreByCondition updated nodes > 0", n > 0); } 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=1338403&r1=1338402&r2=1338403&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 Mon May 14 20:59:54 2012 @@ -446,7 +446,7 @@ public class EntityUtil { search.putAll(find); } if (now.equals(search.get("fromDate"))) { - return EntityUtil.getOnly(delegator.findByAnd(entityName, search)); + return EntityUtil.getOnly(delegator.findByAnd(entityName, search, null, false)); } else { search.put("fromDate",now); search.remove("thruDate"); Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java (original) +++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java Mon May 14 20:59:54 2012 @@ -42,7 +42,7 @@ public class EntityGroupUtil { public static Set<String> getEntityNamesByGroup(String entityGroupId, Delegator delegator, boolean requireStampFields) throws GenericEntityException { Set<String> entityNames = FastSet.newInstance(); - List<GenericValue> entitySyncGroupIncludes = delegator.findByAnd("EntityGroupEntry", UtilMisc.toMap("entityGroupId", entityGroupId)); + List<GenericValue> entitySyncGroupIncludes = delegator.findByAnd("EntityGroupEntry", UtilMisc.toMap("entityGroupId", entityGroupId), null, false); List<ModelEntity> modelEntities = getModelEntitiesFromRecords(entitySyncGroupIncludes, delegator, requireStampFields); for (ModelEntity modelEntity: modelEntities) { Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java (original) +++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java Mon May 14 20:59:54 2012 @@ -321,7 +321,7 @@ public class EntityDataLoadContainer imp //Debug.logInfo("- loaded default component : " + component.getString("componentName"), module); } Debug.logInfo("- Loaded components by default : " + components.size() + " components", module); - List<GenericValue> tenantComponents = delegator.findByAnd("TenantComponent", UtilMisc.toMap("tenantId", delegator.getDelegatorTenantId()), UtilMisc.toList("sequenceNum")); + List<GenericValue> tenantComponents = delegator.findByAnd("TenantComponent", UtilMisc.toMap("tenantId", delegator.getDelegatorTenantId()), UtilMisc.toList("sequenceNum"), false); for (GenericValue tenantComponent : tenantComponents) { loadComponents.add(tenantComponent.getString("componentName")); //Debug.logInfo("- loaded component by tenantId : " + tenantComponent.getString("tenantId") +", component : " + tenantComponent.getString("componentName"), module); @@ -329,7 +329,7 @@ public class EntityDataLoadContainer imp Debug.logInfo("- Loaded components by tenantId : " + delegator.getDelegatorTenantId() + ", " + tenantComponents.size() + " components", module); } else { List<GenericValue> tenantComponents = delegator.findByAnd("TenantComponent", UtilMisc.toMap("tenantId", delegator.getDelegatorTenantId(), "componentName", this.component), - UtilMisc.toList("sequenceNum")); + UtilMisc.toList("sequenceNum"), false); for (GenericValue tenantComponent : tenantComponents) { loadComponents.add(tenantComponent.getString("componentName")); //Debug.logInfo("- loaded component by tenantId : " + tenantComponent.getString("tenantId") +", component : " + tenantComponent.getString("componentName"), module); Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java (original) +++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java Mon May 14 20:59:54 2012 @@ -647,7 +647,7 @@ public class EntityPermissionChecker { if (hasNeed) { try { if (UtilValidate.isNotEmpty(partyId)) { - List<GenericValue> partyRoleList = delegator.findByAndCache("PartyRole", UtilMisc.toMap("partyId", partyId)); + List<GenericValue> partyRoleList = delegator.findByAnd("PartyRole", UtilMisc.toMap("partyId", partyId), null, true); for (GenericValue partyRole: partyRoleList) { String roleTypeId = partyRole.getString("roleTypeId"); for (String thisRole: newHasRoleList) { @@ -1179,7 +1179,7 @@ public class EntityPermissionChecker { if (UtilValidate.isEmpty(this.entityName)) { return; } - List<GenericValue> values = delegator.findByAndCache(this.entityName, UtilMisc.toMap(this.entityIdName, entityId)); + List<GenericValue> values = delegator.findByAnd(this.entityName, UtilMisc.toMap(this.entityIdName, entityId), null, true); for (GenericValue entity: values) { this.entityList.add(entity.getString(this.auxiliaryFieldName)); } Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java Mon May 14 20:59:54 2012 @@ -84,11 +84,7 @@ public class FindByAnd extends MethodOpe } listAcsr.put(methodContext, delegator.find(entityName, whereCond, null, null, orderByNames, null)); } else { - if (useCache) { - listAcsr.put(methodContext, delegator.findByAndCache(entityName, mapAcsr.get(methodContext), orderByNames)); - } else { - listAcsr.put(methodContext, delegator.findByAnd(entityName, mapAcsr.get(methodContext), orderByNames)); - } + listAcsr.put(methodContext, delegator.findByAnd(entityName, mapAcsr.get(methodContext), orderByNames, useCache)); } } catch (GenericEntityException e) { Debug.logError(e, module); Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java (original) +++ ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java Mon May 14 20:59:54 2012 @@ -74,7 +74,7 @@ public class OFBizSecurity implements Se public Iterator<GenericValue> findUserLoginSecurityGroupByUserLoginId(String userLoginId) { List<GenericValue> collection; try { - collection = delegator.findByAnd("UserLoginSecurityGroup", UtilMisc.toMap("userLoginId", userLoginId), null); + collection = delegator.findByAnd("UserLoginSecurityGroup", UtilMisc.toMap("userLoginId", userLoginId), null, false); } catch (GenericEntityException e) { // make an empty collection to speed up the case where a userLogin belongs to no security groups, only with no exception of course collection = FastList.newInstance(); Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/EntityAuthorization.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/EntityAuthorization.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/EntityAuthorization.java (original) +++ ofbiz/trunk/framework/security/src/org/ofbiz/security/authz/EntityAuthorization.java Mon May 14 20:59:54 2012 @@ -145,7 +145,7 @@ public class EntityAuthorization extends List<GenericValue> collection; try { - collection = delegator.findByAnd("UserLoginSecurityGroup", UtilMisc.toMap("userLoginId", userId), null); + collection = delegator.findByAnd("UserLoginSecurityGroup", UtilMisc.toMap("userLoginId", userId), null, false); } catch (GenericEntityException e) { // make an empty collection to speed up the case where a userLogin belongs to no security groups, only with no exception of course collection = FastList.newInstance(); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyBaseScript.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyBaseScript.groovy?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyBaseScript.groovy (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyBaseScript.groovy Mon May 14 20:59:54 2012 @@ -48,7 +48,7 @@ abstract class GroovyBaseScript extends } List findList(String entityName, Map inputMap) { - List genericValues = binding.getVariable('delegator').findByAnd(entityName, inputMap); + List genericValues = binding.getVariable('delegator').findByAnd(entityName, inputMap, null, false); // TODO: get the list of entity fields from the map and use them only return genericValues; } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/job/JobManager.java Mon May 14 20:59:54 2012 @@ -156,7 +156,7 @@ public class JobManager { delegator.storeByCondition("JobSandbox", updateFields, mainCondition); // now query all the 'queued' jobs for this instance - List<GenericValue> jobEnt = delegator.findByAnd("JobSandbox", updateFields, order); + List<GenericValue> jobEnt = delegator.findByAnd("JobSandbox", updateFields, order, false); //jobEnt = delegator.findByCondition("JobSandbox", mainCondition, null, order); if (UtilValidate.isNotEmpty(jobEnt)) { Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java Mon May 14 20:59:54 2012 @@ -65,15 +65,15 @@ public class ProtectViewWorker { if (userLogin != null) { String userLoginId = userLogin.getString("userLoginId"); try { - List<GenericValue> protectedViews = delegator.findByAndCache("UserLoginAndProtectedView", - UtilMisc.toMap("userLoginId", userLoginId, "viewNameId", viewNameId)); + List<GenericValue> protectedViews = delegator.findByAnd("UserLoginAndProtectedView", + UtilMisc.toMap("userLoginId", userLoginId, "viewNameId", viewNameId), null, true); // Any views to deal with ? if (UtilValidate.isNotEmpty(protectedViews)) { Long now = System.currentTimeMillis(); // we are not in a margin of some milliseconds // Is this login/view couple already tarpitted ? (ie denied access to view for login for a period of time) - List<GenericValue> tarpittedLoginViews = delegator.findByAndCache("TarpittedLoginView", - UtilMisc.toMap("userLoginId", userLoginId, "viewNameId", viewNameId)); + List<GenericValue> tarpittedLoginViews = delegator.findByAnd("TarpittedLoginView", + UtilMisc.toMap("userLoginId", userLoginId, "viewNameId", viewNameId), null, true); String viewNameUserLoginId = viewNameId + userLoginId; if (UtilValidate.isNotEmpty(tarpittedLoginViews)) { GenericValue tarpittedLoginView = tarpittedLoginViews.get(0); Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/workflow/WorkflowMonitor.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/workflow/WorkflowMonitor.groovy?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/workflow/WorkflowMonitor.groovy (original) +++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/workflow/WorkflowMonitor.groovy Mon May 14 20:59:54 2012 @@ -30,7 +30,7 @@ import org.ofbiz.workflow.*; workflow = parameters.workflow; workflowDef = null; if (!workflow) { - runningProcesses = delegator.findByAnd("WorkEffort", [workEffortTypeId : "WORK_FLOW", currentStatusId : "WF_RUNNING"]); + runningProcesses = delegator.findByAnd("WorkEffort", [workEffortTypeId : "WORK_FLOW", currentStatusId : "WF_RUNNING"], null, false); if (runningProcesses) { context.runningProcesses = runningProcesses; } @@ -38,7 +38,7 @@ if (!workflow) { workflowDef = delegator.findOne("WorkEffort", [workEffortId : workflow], false); if (workflowDef) { context.workflow = workflowDef; - activities = delegator.findByAnd("WorkEffort", [workEffortParentId : workflow]); + activities = delegator.findByAnd("WorkEffort", [workEffortParentId : workflow], null, false); if (activities) { context.activities = activities; } Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java?rev=1338403&r1=1338402&r2=1338403&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java Mon May 14 20:59:54 2012 @@ -1635,7 +1635,7 @@ public abstract class ModelScreenWidget } else { actualPortalPageId = portalPage.getString("portalPageId"); originalPortalPageId = portalPage.getString("originalPortalPageId"); - portalPageColumns = delegator.findByAndCache("PortalPageColumn", UtilMisc.toMap("portalPageId", actualPortalPageId), UtilMisc.toList("columnSeqId")); + portalPageColumns = delegator.findByAnd("PortalPageColumn", UtilMisc.toMap("portalPageId", actualPortalPageId), UtilMisc.toList("columnSeqId"), true); } } else { String errMsg = "portalPageId is empty."; @@ -1659,7 +1659,7 @@ public abstract class ModelScreenWidget screenStringRenderer.renderPortalPageColumnBegin(writer, context, this, columnValue); // Get the Portlets located in the current column - portalPagePortlets = delegator.findByAnd("PortalPagePortletView", UtilMisc.toMap("portalPageId", portalPage.getString("portalPageId"), "columnSeqId", columnSeqId), UtilMisc.toList("sequenceNum")); + portalPagePortlets = delegator.findByAnd("PortalPagePortletView", UtilMisc.toMap("portalPageId", portalPage.getString("portalPageId"), "columnSeqId", columnSeqId), UtilMisc.toList("sequenceNum"), false); // First Portlet in a Column has no previous Portlet String prevPortletId = ""; |
Free forum by Nabble | Edit this page |