Author: doogie
Date: Sat May 12 21:18:56 2012 New Revision: 1337667 URL: http://svn.apache.org/viewvc?rev=1337667&view=rev Log: DEPRECATION: applications/marketing: findByPrimaryKey variants replaced with findOney Modified: ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/marketing/MarketingServices.java ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java Modified: ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/marketing/MarketingServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/marketing/MarketingServices.java?rev=1337667&r1=1337666&r2=1337667&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/marketing/MarketingServices.java (original) +++ ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/marketing/MarketingServices.java Sat May 12 21:18:56 2012 @@ -68,14 +68,14 @@ public class MarketingServices { try { // locate the contact list Map<String, Object> input = UtilMisc.<String, Object>toMap("contactListId", contactListId); - GenericValue contactList = delegator.findByPrimaryKey("ContactList", input); + GenericValue contactList = delegator.findOne("ContactList", input, false); if (contactList == null) { String error = UtilProperties.getMessage(resourceMarketing, "MarketingContactListNotFound", input, locale); return ServiceUtil.returnError(error); } // perform actions as the system user - GenericValue userLogin = delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId", "system")); + GenericValue userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", "system"), true); // associate the email with anonymous user TODO: do we need a custom contact mech purpose type, say MARKETING_EMAIL? if (partyId == null) { Modified: ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java?rev=1337667&r1=1337666&r2=1337667&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java (original) +++ ofbiz/trunk/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java Sat May 12 21:18:56 2012 @@ -61,7 +61,7 @@ public class TrackingCodeEvents { Delegator delegator = (Delegator) request.getAttribute("delegator"); GenericValue trackingCode; try { - trackingCode = delegator.findByPrimaryKeyCache("TrackingCode", UtilMisc.toMap("trackingCodeId", trackingCodeId)); + trackingCode = delegator.findOne("TrackingCode", UtilMisc.toMap("trackingCodeId", trackingCodeId), true); } catch (GenericEntityException e) { Debug.logError(e, "Error looking up TrackingCode with trackingCodeId [" + trackingCodeId + "], ignoring this trackingCodeId", module); return "error"; @@ -98,7 +98,7 @@ public class TrackingCodeEvents { Delegator delegator = (Delegator) request.getAttribute("delegator"); GenericValue trackingCode; try { - trackingCode = delegator.findByPrimaryKeyCache("TrackingCode", UtilMisc.toMap("trackingCodeId", trackingCodeId)); + trackingCode = delegator.findOne("TrackingCode", UtilMisc.toMap("trackingCodeId", trackingCodeId), true); } catch (GenericEntityException e) { Debug.logError(e, "Error looking up TrackingCode with trackingCodeId [" + trackingCodeId + "], ignoring this trackingCodeId", module); return "error"; @@ -114,7 +114,7 @@ public class TrackingCodeEvents { if (UtilValidate.isNotEmpty(dtc)) { GenericValue defaultTrackingCode = null; try { - defaultTrackingCode = delegator.findByPrimaryKeyCache("TrackingCode", UtilMisc.toMap("trackingCodeId", dtc)); + defaultTrackingCode = delegator.findOne("TrackingCode", UtilMisc.toMap("trackingCodeId", dtc), true); } catch (GenericEntityException e) { Debug.logError(e, "Error looking up Default values TrackingCode with trackingCodeId [" + dtc + "], not using the dtc value for new TrackingCode defaults", module); } @@ -211,7 +211,7 @@ public class TrackingCodeEvents { 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) { cookieDomain = webSite.getString("cookieDomain"); } @@ -324,7 +324,7 @@ public class TrackingCodeEvents { String trackingCodeId = cookies[i].getValue(); GenericValue trackingCode; try { - trackingCode = delegator.findByPrimaryKeyCache("TrackingCode", UtilMisc.toMap("trackingCodeId", trackingCodeId)); + trackingCode = delegator.findOne("TrackingCode", UtilMisc.toMap("trackingCodeId", trackingCodeId), true); } catch (GenericEntityException e) { Debug.logError(e, "Error looking up TrackingCode with trackingCodeId [" + trackingCodeId + "], ignoring this trackingCodeId", module); continue; @@ -386,7 +386,7 @@ public class TrackingCodeEvents { // find the tracking code object GenericValue trackingCode = null; try { - trackingCode = delegator.findByPrimaryKeyCache("TrackingCode", UtilMisc.toMap("trackingCodeId", trackingCodeId)); + trackingCode = delegator.findOne("TrackingCode", UtilMisc.toMap("trackingCodeId", trackingCodeId), true); } catch (GenericEntityException e) { Debug.logError(e, "Error looking up TrackingCode with trackingCodeId [" + trackingCodeId + "], ignoring this trackingCodeId", module); } @@ -484,7 +484,7 @@ public class TrackingCodeEvents { } GenericValue trackingCode = null; try { - trackingCode = delegator.findByPrimaryKeyCache("TrackingCode", UtilMisc.toMap("trackingCodeId", trackingCodeId)); + trackingCode = delegator.findOne("TrackingCode", UtilMisc.toMap("trackingCodeId", trackingCodeId), true); } catch (GenericEntityException e) { Debug.logError(e, "Error looking up TrackingCode with trackingCodeId [" + trackingCodeId + "], ignoring this trackingCodeId", module); } |
Free forum by Nabble | Edit this page |