Author: doogie
Date: Sat May 12 21:21:31 2012
New Revision: 1337681

URL: http://svn.apache.org/viewvc?rev=1337681&view=rev
Log:
DEPRECATION: specialpurpose/pos: findByPrimaryKey variants replaced with
findOne

Modified:
    ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java
    
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/adaptor/SyncCallbackAdaptor.java
    ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/container/PosContainer.java
    ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java
    ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java

Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java?rev=1337681&r1=1337680&r2=1337681&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java 
(original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Sat 
May 12 21:21:31 2012
@@ -434,7 +434,7 @@ public class PosTransaction implements S
         try {
             Delegator delegator = cart.getDelegator();
             GenericValue product = null;
-            product = delegator.findByPrimaryKeyCache("Product", 
UtilMisc.toMap("productId", productId));
+            product = delegator.findOne("Product", UtilMisc.toMap("productId", 
productId), true);
             if (UtilValidate.isNotEmpty(product) && 
("AGGREGATED".equals(product.getString("productTypeId")) || 
"AGGREGATED_SERVICE".equals(product.getString("productTypeId")))) {
                 return true;
             }
@@ -493,7 +493,7 @@ public class PosTransaction implements S
             Delegator delegator = cart.getDelegator();
             GenericValue product = null;
             ProductConfigWrapper pcw = null;
-            product = delegator.findByPrimaryKeyCache("Product", 
UtilMisc.toMap("productId", productId));
+            product = delegator.findOne("Product", UtilMisc.toMap("productId", 
productId), true);
             if (UtilValidate.isNotEmpty(product) && 
("AGGREGATED".equals(product.getString("productTypeId"))||"AGGREGATED_SERVICE".equals(product.getString("productTypeId"))))
 {
                 // if it's an aggregated item, load the configwrapper and set 
to defaults
                 pcw = new ProductConfigWrapper(delegator, 
session.getDispatcher(), productId, null, null, null, null, null, null);
@@ -929,8 +929,8 @@ public class PosTransaction implements S
             GenericValue facilityContactMech = 
ContactMechWorker.getFacilityContactMechByPurpose(delegator, facilityId, 
UtilMisc.toList("SHIP_ORIG_LOCATION", "PRIMARY_LOCATION"));
             if (facilityContactMech != null) {
                 try {
-                    this.shipAddress = 
session.getDelegator().findByPrimaryKey("PostalAddress",
-                            UtilMisc.toMap("contactMechId", 
facilityContactMech.getString("contactMechId")));
+                    this.shipAddress = 
session.getDelegator().findOne("PostalAddress",
+                            UtilMisc.toMap("contactMechId", 
facilityContactMech.getString("contactMechId")), false);
                 } catch (GenericEntityException e) {
                     Debug.logError(e, module);
                 }
@@ -965,7 +965,7 @@ public class PosTransaction implements S
                 if (this.isAggregatedItem(item.getProductId())) {
                     // put alterations here
                     ProductConfigWrapper pcw = null;
-                    // product = delegator.findByPrimaryKeyCache("Product", 
UtilMisc.toMap("productId", productId));
+                    // product = delegator.findOne("Product", 
UtilMisc.toMap("productId", productId), true);
                     // pcw = new ProductConfigWrapper(delegator, 
session.getDispatcher(), productId, null, null, null, null, null, null);
                     pcw = item.getConfigWrapper();
                     List<ConfigOption> selected = pcw.getSelectedOptions();
@@ -1800,7 +1800,7 @@ public class PosTransaction implements S
             GenericValue  person = null;
 
             try {
-                person = session.getDelegator().findByPrimaryKey("Person", 
UtilMisc.toMap("partyId", partyId));
+                person = session.getDelegator().findOne("Person", 
UtilMisc.toMap("partyId", partyId), false);
             } catch (GenericEntityException e) {
                 Debug.logError(e, module);
                 pos.showDialog("dialog/error/exception", e.getMessage());

Modified: 
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/adaptor/SyncCallbackAdaptor.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/adaptor/SyncCallbackAdaptor.java?rev=1337681&r1=1337680&r2=1337681&view=diff
==============================================================================
--- 
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/adaptor/SyncCallbackAdaptor.java
 (original)
+++ 
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/adaptor/SyncCallbackAdaptor.java
 Sat May 12 21:21:31 2012
@@ -53,7 +53,7 @@ public class SyncCallbackAdaptor impleme
         if (ctxSyncId != null && entitySyncId.equals(ctxSyncId)) {
             GenericValue entitySync = null;
             try {
-                entitySync = 
screen.getSession().getDelegator().findByPrimaryKey("EntitySync", 
UtilMisc.toMap("entitySyncId", entitySyncId));
+                entitySync = 
screen.getSession().getDelegator().findOne("EntitySync", 
UtilMisc.toMap("entitySyncId", entitySyncId), false);
             } catch (GenericEntityException e) {
                 Debug.logError(e, module);
             }

Modified: 
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/container/PosContainer.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/container/PosContainer.java?rev=1337681&r1=1337680&r2=1337681&view=diff
==============================================================================
--- 
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/container/PosContainer.java 
(original)
+++ 
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/container/PosContainer.java 
Sat May 12 21:21:31 2012
@@ -49,7 +49,7 @@ public class PosContainer extends XuiCon
             throw new ContainerException("No facility-id value set in 
pos-container!");
         } else {
             try {
-                facility = session.getDelegator().findByPrimaryKey("Facility", 
UtilMisc.toMap("facilityId", facilityId));
+                facility = session.getDelegator().findOne("Facility", 
UtilMisc.toMap("facilityId", facilityId), false);
             } catch (GenericEntityException e) {
                 throw new ContainerException("Invalid facilityId : " + 
facilityId);
             }

Modified: 
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java?rev=1337681&r1=1337680&r2=1337681&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java 
(original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java 
Sat May 12 21:21:31 2012
@@ -295,7 +295,7 @@ public class ManagerEvents {
             String orderId = input.value();
             GenericValue orderHeader = null;
             try {
-                orderHeader = 
session.getDelegator().findByPrimaryKey("OrderHeader", 
UtilMisc.toMap("orderId", orderId));
+                orderHeader = session.getDelegator().findOne("OrderHeader", 
UtilMisc.toMap("orderId", orderId), false);
             } catch (GenericEntityException e) {
                 Debug.logError(e, module);
             }

Modified: 
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java?rev=1337681&r1=1337680&r2=1337681&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java 
(original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/ClientProfile.java 
Sat May 12 21:21:31 2012
@@ -141,7 +141,7 @@ public class ClientProfile extends XPage
         if (!cancelled) {
             GenericValue  person = null;
             try {
-                person = 
m_trans.getSession().getDelegator().findByPrimaryKey("Person", 
UtilMisc.toMap("partyId", m_partyId));
+                person = m_trans.getSession().getDelegator().findOne("Person", 
UtilMisc.toMap("partyId", m_partyId), false);
             } catch (GenericEntityException e) {
                 Debug.logError(e, module);
             }


Reply via email to