Author: doogie
Date: Sat May 12 21:17:55 2012
New Revision: 1337662
URL: http://svn.apache.org/viewvc?rev=1337662&view=rev
Log:
DEPRECATION: framework: findByPrimaryKey variants replaced with findOne
Modified:
ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java
ofbiz/trunk/framework/common/src/org/ofbiz/common/email/NotificationServices.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/webcommon/WEB-INF/actions/includes/GetParentPortalPageId.groovy
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/cache/EntityCacheServices.java
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataLoadContainer.java
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaAction.java
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java
ofbiz/trunk/framework/jcr/src/org/ofbiz/jcr/test/JackrabbitTests.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java
ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java
ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntityPerformanceTest.groovy
ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/workflow/WorkflowMonitor.groovy
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapperImage.java
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java
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=1337662&r1=1337661&r2=1337662&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java
(original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/UrlServletHelper.java Sat
May 12 21:17:55 2012
@@ -155,7 +155,7 @@ public class UrlServletHelper extends Co
// check path alias
GenericValue pathAlias = null;
try {
- pathAlias = delegator.findByPrimaryKeyCache("WebSitePathAlias",
UtilMisc.toMap("webSiteId", webSiteId, "pathAlias", pathInfo));
+ pathAlias = delegator.findOne("WebSitePathAlias",
UtilMisc.toMap("webSiteId", webSiteId, "pathAlias", pathInfo), true);
} catch (GenericEntityException e) {
Debug.logError(e, module);
}
Modified:
ofbiz/trunk/framework/common/src/org/ofbiz/common/email/NotificationServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/email/NotificationServices.java?rev=1337662&r1=1337661&r2=1337662&view=diff
==============================================================================
---
ofbiz/trunk/framework/common/src/org/ofbiz/common/email/NotificationServices.java
(original)
+++
ofbiz/trunk/framework/common/src/org/ofbiz/common/email/NotificationServices.java
Sat May 12 21:17:55 2012
@@ -279,7 +279,7 @@ public class NotificationServices {
GenericValue webSite = null;
if (webSiteId != null) {
try {
- webSite = delegator.findByPrimaryKeyCache("WebSite",
UtilMisc.toMap("webSiteId", webSiteId));
+ webSite = delegator.findOne("WebSite",
UtilMisc.toMap("webSiteId", webSiteId), true);
if (webSite != null) {
httpsPort = webSite.getString("httpsPort");
httpsServer = webSite.getString("httpsHost");
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=1337662&r1=1337661&r2=1337662&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 Sat
May 12 21:17:55 2012
@@ -42,7 +42,7 @@ public class GeoWorker {
public static List<GenericValue> expandGeoGroup(String geoId, Delegator
delegator) {
GenericValue geo = null;
try {
- geo = delegator.findByPrimaryKeyCache("Geo",
UtilMisc.toMap("geoId", geoId));
+ geo = delegator.findOne("Geo", UtilMisc.toMap("geoId", geoId),
true);
} catch (GenericEntityException e) {
Debug.logError(e, "Unable to look up Geo from geoId : " + geoId,
module);
}
@@ -108,7 +108,7 @@ public class GeoWorker {
public static boolean containsGeo(List<GenericValue> geoList, String
geoId, Delegator delegator) {
GenericValue geo = null;
try {
- geo = delegator.findByPrimaryKeyCache("Geo",
UtilMisc.toMap("geoId", geoId));
+ geo = delegator.findOne("Geo", UtilMisc.toMap("geoId", geoId),
true);
} catch (GenericEntityException e) {
Debug.logError(e, "Unable to look up Geo from geoId : " + geoId,
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=1337662&r1=1337661&r2=1337662&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
Sat May 12 21:17:55 2012
@@ -722,7 +722,7 @@ public class LoginServices {
if (UtilValidate.isNotEmpty(partyId)) {
//GenericValue party = null;
//try {
- // party = delegator.findByPrimaryKey("Party",
UtilMisc.toMap("partyId", partyId));
+ // party = delegator.findOne("Party", UtilMisc.toMap("partyId",
partyId), false);
//} catch (GenericEntityException e) {
// Debug.logWarning(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=1337662&r1=1337661&r2=1337662&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
Sat May 12 21:17:55 2012
@@ -53,7 +53,7 @@ if (userLogin && parameters.parentPortal
}
// Debug.log('======portalPageId: ' + parameters.portalPageId);
if (userLogin && parameters.portalPageId) {
- portalPage = delegator.findByPrimaryKey("PortalPage", [portalPageId :
parameters.portalPageId]);
+ portalPage = delegator.findOne("PortalPage", [portalPageId :
parameters.portalPageId], false);
if (portalPage) {
if (portalPage.parentPortalPageId) {
context.parameters.parentPortalPageId =
portalPage.parentPortalPageId;
Modified:
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/cache/EntityCacheServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/cache/EntityCacheServices.java?rev=1337662&r1=1337661&r2=1337662&view=diff
==============================================================================
---
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/cache/EntityCacheServices.java
(original)
+++
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/cache/EntityCacheServices.java
Sat May 12 21:17:55 2012
@@ -57,7 +57,7 @@ public class EntityCacheServices impleme
public GenericValue getAuthUserLogin() {
GenericValue userLogin = null;
try {
- userLogin = delegator.findByPrimaryKeyCache("UserLogin",
UtilMisc.toMap("userLoginId", userLoginId));
+ userLogin = delegator.findOne("UserLogin",
UtilMisc.toMap("userLoginId", userLoginId), true);
} catch (GenericEntityException e) {
Debug.logError(e, "Error finding the userLogin for distributed
cache clear", module);
}
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=1337662&r1=1337661&r2=1337662&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
Sat May 12 21:17:55 2012
@@ -296,7 +296,7 @@ public class EntityDataLoadContainer imp
componentEntry.set("componentName", config.getComponentName());
componentEntry.set("rootLocation", config.getRootLocation());
try {
- GenericValue componentCheck =
delegator.findByPrimaryKey("Component", UtilMisc.toMap("componentName",
config.getComponentName()));
+ GenericValue componentCheck = delegator.findOne("Component",
UtilMisc.toMap("componentName", config.getComponentName()), false);
if (UtilValidate.isEmpty(componentCheck)) {
componentEntry.create();
} else {
Modified:
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaAction.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaAction.java?rev=1337662&r1=1337661&r2=1337662&view=diff
==============================================================================
---
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaAction.java
(original)
+++
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaAction.java
Sat May 12 21:17:55 2012
@@ -82,7 +82,7 @@ public class EntityEcaAction implements
// setup the run-as-user
GenericValue userLoginToRunAs = null;
if (UtilValidate.isNotEmpty(this.runAsUser)) {
- userLoginToRunAs =
dctx.getDelegator().findByPrimaryKeyCache("UserLogin",
UtilMisc.toMap("userLoginId", this.runAsUser));
+ userLoginToRunAs = dctx.getDelegator().findOne("UserLogin",
UtilMisc.toMap("userLoginId", this.runAsUser), true);
if (userLoginToRunAs != null) {
actionContext.put("userLogin", userLoginToRunAs);
}
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=1337662&r1=1337661&r2=1337662&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
Sat May 12 21:17:55 2012
@@ -276,7 +276,7 @@ public class EntityPermissionChecker {
int privilegeEnumSeq = -1;
if (UtilValidate.isNotEmpty(privilegeEnumId)) {
- GenericValue privEnum =
delegator.findByPrimaryKeyCache("Enumeration", UtilMisc.toMap("enumId",
privilegeEnumId));
+ GenericValue privEnum = delegator.findOne("Enumeration",
UtilMisc.toMap("enumId", privilegeEnumId), true);
if (privEnum != null) {
String sequenceId = privEnum.getString("sequenceId");
try {
@@ -296,7 +296,7 @@ public class EntityPermissionChecker {
String targetPrivilegeEnumId =
entity.getString("privilegeEnumId");
if (UtilValidate.isNotEmpty(targetPrivilegeEnumId)) {
int targetPrivilegeEnumSeq = -1;
- GenericValue privEnum =
delegator.findByPrimaryKeyCache("Enumeration", UtilMisc.toMap("enumId",
privilegeEnumId));
+ GenericValue privEnum = delegator.findOne("Enumeration",
UtilMisc.toMap("enumId", privilegeEnumId), true);
if (privEnum != null) {
String sequenceId = privEnum.getString("sequenceId");
try {
@@ -433,7 +433,7 @@ public class EntityPermissionChecker {
/*
String ownedEntityId = entity.getString("owner" +
entityName + "Id");
- GenericValue ownedEntity =
delegator.findByPrimaryKeyCache(entityName,UtilMisc.toMap(pkFieldName,
ownedEntityId));
+ GenericValue ownedEntity =
delegator.findOne(entityName,UtilMisc.toMap(pkFieldName, ownedEntityId), true);
while (ownedEntity != null) {
if (!alreadyCheckedIds.contains(ownedEntityId)) {
// Decided to let the original purposes only be used
in permission checking
@@ -454,7 +454,7 @@ public class EntityPermissionChecker {
//purposes.put(ownedEntityId, purposeList);
//roles.put(ownedEntityId, roleList);
ownedEntityId = ownedEntity.getString("owner" +
entityName + "Id");
- ownedEntity =
delegator.findByPrimaryKeyCache(entityName,UtilMisc.toMap(pkFieldName,
ownedEntityId));
+ ownedEntity =
delegator.findOne(entityName,UtilMisc.toMap(pkFieldName, ownedEntityId), true);
} else {
ownedEntity = null;
}
@@ -608,7 +608,7 @@ public class EntityPermissionChecker {
String entityId = (String)obj;
if (entities != null) entity = entities.get(entityId);
- if (entity == null) entity =
delegator.findByPrimaryKeyCache(entityName,UtilMisc.toMap(pkFieldName,
entityId));
+ if (entity == null) entity =
delegator.findOne(entityName,UtilMisc.toMap(pkFieldName, entityId), true);
} else if (obj instanceof GenericValue) {
entity = (GenericValue)obj;
}
@@ -1001,7 +1001,7 @@ public class EntityPermissionChecker {
privilegeEnumId =
currentValue.getString(this.privilegeFieldName);
}
if (UtilValidate.isNotEmpty(privilegeEnumId)) {
- GenericValue privEnum =
delegator.findByPrimaryKeyCache("Enumeration", UtilMisc.toMap("enumId",
privilegeEnumId));
+ GenericValue privEnum = delegator.findOne("Enumeration",
UtilMisc.toMap("enumId", privilegeEnumId), true);
if (privEnum != null) {
String sequenceId = privEnum.getString("sequenceId");
try {
@@ -1293,7 +1293,7 @@ public class EntityPermissionChecker {
if (entity.get("createdByUserLogin") != null) {
String userLoginIdCB =
(String)entity.get("createdByUserLogin");
try {
- GenericValue userLogin =
delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId",
userLoginIdCB));
+ GenericValue userLogin = delegator.findOne("UserLogin",
UtilMisc.toMap("userLoginId", userLoginIdCB), true);
if (userLogin != null) {
String partyIdCB = userLogin.getString("partyId");
if (partyIdCB != null) {
@@ -1346,7 +1346,7 @@ public class EntityPermissionChecker {
contentOwnerList.add(ownerContentId);
ModelEntity modelEntity = delegator.getModelEntity(entityName);
String pkFieldName = modelEntity.getFirstPkFieldName();
- GenericValue ownerContent =
delegator.findByPrimaryKeyCache(entityName, UtilMisc.toMap(pkFieldName,
ownerContentId));
+ GenericValue ownerContent = delegator.findOne(entityName,
UtilMisc.toMap(pkFieldName, ownerContentId), true);
if (ownerContent != null) {
getEntityOwners(delegator, ownerContent, contentOwnerList,
entityName, ownerIdFieldName);
}
@@ -1358,7 +1358,7 @@ public class EntityPermissionChecker {
int privilegeEnumSeq = -1;
if (UtilValidate.isNotEmpty(privilegeEnumId)) {
- GenericValue privEnum =
delegator.findByPrimaryKeyCache("Enumeration", UtilMisc.toMap("enumId",
privilegeEnumId));
+ GenericValue privEnum = delegator.findOne("Enumeration",
UtilMisc.toMap("enumId", privilegeEnumId), true);
if (privEnum != null) {
String sequenceId = privEnum.getString("sequenceId");
try {
Modified: ofbiz/trunk/framework/jcr/src/org/ofbiz/jcr/test/JackrabbitTests.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/jcr/src/org/ofbiz/jcr/test/JackrabbitTests.java?rev=1337662&r1=1337661&r2=1337662&view=diff
==============================================================================
--- ofbiz/trunk/framework/jcr/src/org/ofbiz/jcr/test/JackrabbitTests.java
(original)
+++ ofbiz/trunk/framework/jcr/src/org/ofbiz/jcr/test/JackrabbitTests.java Sat
May 12 21:17:55 2012
@@ -60,7 +60,7 @@ public class JackrabbitTests extends OFB
@Override
protected void setUp() throws Exception {
- userLogin = delegator.findByPrimaryKey("UserLogin",
UtilMisc.toMap("userLoginId", "system"));
+ userLogin = delegator.findOne("UserLogin",
UtilMisc.toMap("userLoginId", "system"), false);
}
@@ -314,7 +314,7 @@ public class JackrabbitTests extends OFB
public void testSpeedTestService() throws Exception {
Map<String, Object> context = FastMap.newInstance();
context.put("maxNodes", new Integer(10));
- context.put("userLogin",
dispatcher.getDelegator().findByPrimaryKey("UserLogin",
UtilMisc.toMap("userLoginId", "system")));
+ context.put("userLogin",
dispatcher.getDelegator().findOne("UserLogin", UtilMisc.toMap("userLoginId",
"system"), false));
Map<String, Object> serviceResult =
this.dispatcher.runSync("determineJackrabbitRepositorySpeed", context);
Modified:
ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java?rev=1337662&r1=1337661&r2=1337662&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java
(original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceDispatcher.java
Sat May 12 21:17:55 2012
@@ -907,7 +907,7 @@ public class ServiceDispatcher {
//The old way: GenericValue newUserLogin =
getLoginObject(service, localName, userLogin.getString("userLoginId"),
userLogin.getString("currentPassword"), (Locale) context.get("locale"));
GenericValue newUserLogin = null;
try {
- newUserLogin =
this.getDelegator().findByPrimaryKeyCache("UserLogin", "userLoginId",
userLogin.get("userLoginId"));
+ newUserLogin = this.getDelegator().findOne("UserLogin",
true, "userLoginId", userLogin.get("userLoginId"));
} catch (GenericEntityException e) {
Debug.logError(e, "Error looking up service authentication
UserLogin: " + e.toString(), module);
// leave newUserLogin null, will be handled below
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java?rev=1337662&r1=1337661&r2=1337662&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java
(original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java Sat
May 12 21:17:55 2012
@@ -605,7 +605,7 @@ public class ServiceUtil {
Delegator delegator = dctx.getDelegator();
if (UtilValidate.isNotEmpty(runAsUser)) {
try {
- GenericValue runAs =
delegator.findByPrimaryKeyCache("UserLogin", "userLoginId", runAsUser);
+ GenericValue runAs = delegator.findOne("UserLogin", true,
"userLoginId", runAsUser);
if (runAs != null) {
userLogin = runAs;
}
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=1337662&r1=1337661&r2=1337662&view=diff
==============================================================================
---
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
(original)
+++
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
Sat May 12 21:17:55 2012
@@ -211,7 +211,7 @@ public class RequestHandler {
String webSiteId = WebSiteWorker.getWebSiteId(request);
if (webSiteId != null) {
try {
- GenericValue webSite =
delegator.findByPrimaryKeyCache("WebSite", UtilMisc.toMap("webSiteId",
webSiteId));
+ GenericValue webSite =
delegator.findOne("WebSite", UtilMisc.toMap("webSiteId", webSiteId), true);
if (webSite != null) enableHttps =
webSite.getBoolean("enableHttps");
} catch (GenericEntityException e) {
Debug.logWarning(e, "Problems with WebSite entity;
using global defaults", module);
@@ -1005,7 +1005,7 @@ public class RequestHandler {
GenericValue webSite;
if (webSiteId != null) {
try {
- webSite = delegator.findByPrimaryKeyCache("WebSite",
UtilMisc.toMap("webSiteId", webSiteId));
+ webSite = delegator.findOne("WebSite",
UtilMisc.toMap("webSiteId", webSiteId), true);
if (webSite != null) {
httpsPort = webSite.getString("httpsPort");
httpsServer = webSite.getString("httpsHost");
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java?rev=1337662&r1=1337661&r2=1337662&view=diff
==============================================================================
---
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java
(original)
+++
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/ftl/OfbizUrlTransform.java
Sat May 12 21:17:55 2012
@@ -112,7 +112,7 @@ public class OfbizUrlTransform implement
StringBuilder newURL = new StringBuilder();
// make prefix url
try {
- GenericValue webSite =
delegator.findByPrimaryKeyCache("WebSite", UtilMisc.toMap("webSiteId",
webSiteId));
+ GenericValue webSite =
delegator.findOne("WebSite", UtilMisc.toMap("webSiteId", webSiteId), true);
if (webSite != null) {
httpsPort = webSite.getString("httpsPort");
httpsServer = webSite.getString("httpsHost");
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java?rev=1337662&r1=1337661&r2=1337662&view=diff
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java
(original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/ServerHitBin.java
Sat May 12 21:17:55 2012
@@ -609,7 +609,7 @@ public class ServerHitBin {
// check for type data before running.
GenericValue serverHitType = null;
- serverHitType = delegator.findByPrimaryKeyCache("ServerHitType",
UtilMisc.toMap("hitTypeId", ServerHitBin.typeIds[this.type]));
+ serverHitType = delegator.findOne("ServerHitType",
UtilMisc.toMap("hitTypeId", ServerHitBin.typeIds[this.type]), true);
if (serverHitType == null) {
// datamodel data not loaded; not storing hit.
Debug.logWarning("The datamodel data has not been loaded;
cannot find hitTypeId '" + ServerHitBin.typeIds[this.type] + " not storing
ServerHit.", module);
Modified:
ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntityPerformanceTest.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntityPerformanceTest.groovy?rev=1337662&r1=1337661&r2=1337662&view=diff
==============================================================================
---
ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntityPerformanceTest.groovy
(original)
+++
ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntityPerformanceTest.groovy
Sat May 12 21:17:55 2012
@@ -33,13 +33,13 @@ if (security.hasPermission("ENTITY_MAINT
calls = 1000;
startTime = System.currentTimeMillis();
for (int i = 0; i < calls; i++) {
- dummy = delegator.findByPrimaryKey("JobSandbox", [jobId :
"PURGE_OLD_JOBS"]);
+ dummy = delegator.findOne("JobSandbox", [jobId : "PURGE_OLD_JOBS"],
false);
}
totalTime = System.currentTimeMillis() - startTime;
callsPerSecond = calls / (totalTime/1000);
perfRow = [:];
- perfRow.operation = "findByPrimaryKey";
+ perfRow.operation = "findOne(false)";
perfRow.entity = "Large:JobSandbox";
perfRow.calls = decimalFormat.format(calls);
perfRow.seconds = decimalFormat.format(totalTime / 1000);
@@ -50,13 +50,13 @@ if (security.hasPermission("ENTITY_MAINT
calls = 10000;
startTime = System.currentTimeMillis();
for (int i = 0; i < calls; i++) {
- dummy = delegator.findByPrimaryKeyCache("JobSandbox", [jobId :
"PURGE_OLD_JOBS"]);
+ dummy = delegator.findOne("JobSandbox", [jobId : "PURGE_OLD_JOBS"],
true);
}
totalTime = System.currentTimeMillis() - startTime;
callsPerSecond = calls / (totalTime / 1000);
perfRow = [:];
- perfRow.operation = "findByPrimaryKeyCache";
+ perfRow.operation = "findOne(true)";
perfRow.entity = "Large:JobSandbox";
perfRow.calls = decimalFormat.format(calls);
perfRow.seconds = decimalFormat.format(totalTime / 1000);
@@ -67,13 +67,13 @@ if (security.hasPermission("ENTITY_MAINT
calls = 1000;
startTime = System.currentTimeMillis();
for (int i = 0; i < calls; i++) {
- dummy = delegator.findByPrimaryKey("DataSourceType", [dataSourceTypeId
: "ADMIN_ENTRY"]);
+ dummy = delegator.findOne("DataSourceType", [dataSourceTypeId :
"ADMIN_ENTRY"], false);
}
totalTime = System.currentTimeMillis() - startTime;
callsPerSecond = calls / (totalTime / 1000);
perfRow = [:];
- perfRow.operation = "findByPrimaryKey";
+ perfRow.operation = "findOne(false)";
perfRow.entity = "Small:DataSourceType";
perfRow.calls = decimalFormat.format(calls);
perfRow.seconds = decimalFormat.format(totalTime / 1000);
@@ -84,13 +84,13 @@ if (security.hasPermission("ENTITY_MAINT
calls = 10000;
startTime = System.currentTimeMillis();
for (int i=0; i < calls; i++) {
- dummy = delegator.findByPrimaryKeyCache("DataSourceType",
[dataSourceTypeId : "ADMIN_ENTRY"]);
+ dummy = delegator.findOne("DataSourceType", [dataSourceTypeId :
"ADMIN_ENTRY"], true);
}
totalTime = System.currentTimeMillis() - startTime;
callsPerSecond = calls / (totalTime / 1000);
perfRow = [:];
- perfRow.operation = "findByPrimaryKeyCache";
+ perfRow.operation = "findOne(true)";
perfRow.entity = "Small:DataSourceType";
perfRow.calls = decimalFormat.format(calls);
perfRow.seconds = decimalFormat.format(totalTime / 1000);
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=1337662&r1=1337661&r2=1337662&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
Sat May 12 21:17:55 2012
@@ -35,7 +35,7 @@ if (!workflow) {
context.runningProcesses = runningProcesses;
}
} else {
- workflowDef = delegator.findByPrimaryKey("WorkEffort", [workEffortId :
workflow]);
+ workflowDef = delegator.findOne("WorkEffort", [workEffortId : workflow],
false);
if (workflowDef) {
context.workflow = workflowDef;
activities = delegator.findByAnd("WorkEffort", [workEffortParentId :
workflow]);
Modified:
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapperImage.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapperImage.java?rev=1337662&r1=1337661&r2=1337662&view=diff
==============================================================================
---
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapperImage.java
(original)
+++
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlMenuWrapperImage.java
Sat May 12 21:17:55 2012
@@ -67,7 +67,7 @@ public class HtmlMenuWrapperImage extend
for (ModelMenuItem menuItem : modelMenu.getMenuItemList()) {
String contentId = menuItem.getAssociatedContentId(dummyMap);
//if (Debug.infoOn()) Debug.logInfo("in init, contentId:" +
contentId, module);
- GenericValue webSitePublishPoint =
delegator.findByPrimaryKeyCache("WebSitePublishPoint",
UtilMisc.toMap("contentId", contentId));
+ GenericValue webSitePublishPoint =
delegator.findOne("WebSitePublishPoint", UtilMisc.toMap("contentId",
contentId), true);
String menuItemName = menuItem.getName();
//if (Debug.infoOn()) Debug.logInfo("in init, menuItemName:" +
menuItemName, module);
//if (Debug.infoOn()) Debug.logInfo("in init,
webSitePublishPoint:" + webSitePublishPoint, module);
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=1337662&r1=1337661&r2=1337662&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
Sat May 12 21:17:55 2012
@@ -980,7 +980,7 @@ public abstract class ModelScreenWidget
if (UtilValidate.isEmpty(expandedDataResourceId)) {
if (UtilValidate.isNotEmpty(expandedContentId)) {
- content = delegator.findByPrimaryKeyCache("Content",
UtilMisc.toMap("contentId", expandedContentId));
+ content = delegator.findOne("Content",
UtilMisc.toMap("contentId", expandedContentId), true);
} else {
String errMsg = "contentId is empty.";
Debug.logError(errMsg, module);
@@ -997,7 +997,7 @@ public abstract class ModelScreenWidget
GenericValue dataResource = null;
if (UtilValidate.isNotEmpty(expandedDataResourceId)) {
- dataResource =
delegator.findByPrimaryKeyCache("DataResource",
UtilMisc.toMap("dataResourceId", expandedDataResourceId));
+ dataResource = delegator.findOne("DataResource",
UtilMisc.toMap("dataResourceId", expandedDataResourceId), true);
}
String mimeTypeId = null;
@@ -1626,7 +1626,7 @@ public abstract class ModelScreenWidget
portalPage =
PortalPageWorker.getPortalPage(expandedPortalPageId, context);
}
else {
- portalPage =
delegator.findByPrimaryKeyCache("PortalPage", UtilMisc.toMap("portalPageId",
expandedPortalPageId));
+ portalPage = delegator.findOne("PortalPage",
UtilMisc.toMap("portalPageId", expandedPortalPageId), true);
}
if (portalPage == null) {
String errMsg = "Could not find PortalPage with
portalPageId [" + expandedPortalPageId + "] ";
Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java?rev=1337662&r1=1337661&r2=1337662&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java
(original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java Sat
May 12 21:17:55 2012
@@ -500,7 +500,7 @@ public class ModelTree extends ModelWidg
if (UtilValidate.isNotEmpty(id)) {
try {
int leafCount =
ContentManagementWorker.updateStatsTopDown(delegator, id,
UtilMisc.toList("SUB_CONTENT", "PUBLISH_LINK"));
- GenericValue entity =
delegator.findByPrimaryKeyCache(entName, UtilMisc.toMap(modelTree.getPkName(),
id));
+ GenericValue entity = delegator.findOne(entName,
UtilMisc.toMap(modelTree.getPkName(), id), true);
obj = entity.get("childBranchCount");
if (obj != null)
nodeCount = (Long)obj;