Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Sat May 12 21:19:35 2012 @@ -1319,7 +1319,7 @@ public class ShoppingCart implements Ite return null; } try { - GenericValue party = this.getDelegator().findByPrimaryKeyCache("Party", UtilMisc.toMap("partyId", partyId)); + GenericValue party = this.getDelegator().findOne("Party", UtilMisc.toMap("partyId", partyId), true); if (party == null) { return null; } @@ -1494,7 +1494,7 @@ public class ShoppingCart implements Ite public String getPaymentMethodTypeId(String paymentMethodId) { try { - GenericValue pm = this.getDelegator().findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId)); + GenericValue pm = this.getDelegator().findOne("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); if (pm != null) { return pm.getString("paymentMethodTypeId"); } @@ -1740,7 +1740,7 @@ public class ShoppingCart implements Ite GenericValue paymentMethod = null; try { - paymentMethod = this.getDelegator().findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", inf.paymentMethodId)); + paymentMethod = this.getDelegator().findOne("PaymentMethod", UtilMisc.toMap("paymentMethodId", inf.paymentMethodId), false); } catch (GenericEntityException e) { Debug.logError(e, "ERROR: Unable to get payment method record to expire : " + inf.paymentMethodId, module); } @@ -1785,7 +1785,7 @@ public class ShoppingCart implements Ite if (UtilValidate.isNotEmpty(paymentInfo)) { for(String paymentMethodId : getPaymentMethodIds()) { try { - GenericValue paymentMethod = this.getDelegator().findByPrimaryKeyCache("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId)); + GenericValue paymentMethod = this.getDelegator().findOne("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId), true); if (paymentMethod != null) { methods.add(paymentMethod); } else { @@ -1806,7 +1806,7 @@ public class ShoppingCart implements Ite if (UtilValidate.isNotEmpty(paymentInfo)) { for(String id : getPaymentMethodIds()) { try { - types.add(this.getDelegator().findByPrimaryKeyCache("PaymentMethodType", UtilMisc.toMap("paymentMethodTypeId", id))); + types.add(this.getDelegator().findOne("PaymentMethodType", UtilMisc.toMap("paymentMethodTypeId", id), true)); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get payment method type from the database", module); } @@ -1858,7 +1858,7 @@ public class ShoppingCart implements Ite public boolean isPaymentMethodType(String id) { GenericValue paymentMethodType = null; try { - paymentMethodType = this.getDelegator().findByPrimaryKeyCache("PaymentMethodType", UtilMisc.toMap("paymentMethodTypeId", id)); + paymentMethodType = this.getDelegator().findOne("PaymentMethodType", UtilMisc.toMap("paymentMethodTypeId", id), true); } catch (GenericEntityException e) { Debug.logInfo(e, "Problems getting PaymentMethodType", module); } @@ -1887,7 +1887,7 @@ public class ShoppingCart implements Ite * @throws GenericEntityException */ public GenericValue getGiftCertSettingFromStore(Delegator delegator) throws GenericEntityException { - return delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", getProductStoreId(), "finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId)); + return delegator.findOne("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", getProductStoreId(), "finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId), true); } /** @@ -2197,7 +2197,7 @@ public class ShoppingCart implements Ite // the products already in the cart GenericValue shippingAddress = null; try { - shippingAddress = this.getDelegator().findByPrimaryKey("PostalAddress", UtilMisc.toMap("contactMechId", shippingContactMechId)); + shippingAddress = this.getDelegator().findOne("PostalAddress", UtilMisc.toMap("contactMechId", shippingContactMechId), false); } catch (GenericEntityException gee) { Debug.logError(gee, "Error retrieving the shipping address for contactMechId [" + shippingContactMechId + "].", module); } @@ -2257,8 +2257,8 @@ public class ShoppingCart implements Ite String shipmentMethodTypeId = this.getShipmentMethodTypeId(idx); if (UtilValidate.isNotEmpty(shipmentMethodTypeId)) { try { - return this.getDelegator().findByPrimaryKey("ShipmentMethodType", - UtilMisc.toMap("shipmentMethodTypeId", shipmentMethodTypeId)); + return this.getDelegator().findOne("ShipmentMethodType", + UtilMisc.toMap("shipmentMethodTypeId", shipmentMethodTypeId), false); } catch (GenericEntityException e) { Debug.logWarning(e, module); } @@ -2436,7 +2436,7 @@ public class ShoppingCart implements Ite public GenericValue getShippingAddress(int idx) { if (this.getShippingContactMechId(idx) != null) { try { - return getDelegator().findByPrimaryKey("PostalAddress", UtilMisc.toMap("contactMechId", this.getShippingContactMechId(idx))); + return getDelegator().findOne("PostalAddress", UtilMisc.toMap("contactMechId", this.getShippingContactMechId(idx)), false); } catch (GenericEntityException e) { Debug.logWarning(e.toString(), module); return null; @@ -2486,7 +2486,7 @@ public class ShoppingCart implements Ite // set as the default shipping location the first from the list of available shipping locations if (this.getPartyId() != null && !this.getPartyId().equals("_NA_")) { try { - GenericValue orderParty = this.getDelegator().findByPrimaryKey("Party", UtilMisc.toMap("partyId", this.getPartyId())); + GenericValue orderParty = this.getDelegator().findOne("Party", UtilMisc.toMap("partyId", this.getPartyId()), false); Collection<GenericValue> shippingContactMechList = ContactHelper.getContactMech(orderParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); if (UtilValidate.isNotEmpty(shippingContactMechList)) { GenericValue shippingContactMech = (shippingContactMechList.iterator()).next(); @@ -2642,7 +2642,7 @@ public class ShoppingCart implements Ite if (payment.paymentMethodId != null) { try { // need to determine the payment method type from the payment method - GenericValue paymentMethod = this.getDelegator().findByPrimaryKeyCache("PaymentMethod", UtilMisc.toMap("paymentMethodId", payment.paymentMethodId)); + GenericValue paymentMethod = this.getDelegator().findOne("PaymentMethod", UtilMisc.toMap("paymentMethodId", payment.paymentMethodId), true); if (paymentMethod != null) { thisPaymentMethodTypeId = paymentMethod.getString("paymentMethodTypeId"); } @@ -3329,7 +3329,7 @@ public class ShoppingCart implements Ite String productName = product.getString("productName"); String description = product.getString("description"); Map<String, Object> serviceContext = new HashMap<String, Object>(); - GenericValue permUserLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system")); + GenericValue permUserLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", "system"), false); String internalName = item.getProductId() + "_" + configId; serviceContext.put("internalName", internalName); serviceContext.put("productName", productName); @@ -3757,7 +3757,7 @@ public class ShoppingCart implements Ite if (responses != null) { for(String responseId : responses) { try { - response = this.getDelegator().findByPrimaryKey("SurveyResponse", UtilMisc.toMap("surveyResponseId", responseId)); + response = this.getDelegator().findOne("SurveyResponse", UtilMisc.toMap("surveyResponseId", responseId), false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to obtain SurveyResponse record for ID : " + responseId, module); } @@ -4054,7 +4054,7 @@ public class ShoppingCart implements Ite String facilityId = null; if (UtilValidate.isNotEmpty(this.getProductStoreId())) { try { - GenericValue productStore = this.getDelegator().findByPrimaryKeyCache("ProductStore", UtilMisc.toMap("productStoreId", this.getProductStoreId())); + GenericValue productStore = this.getDelegator().findOne("ProductStore", UtilMisc.toMap("productStoreId", this.getProductStoreId()), true); facilityId = productStore.getString("inventoryFacilityId"); } catch (Exception e) { Debug.logError(UtilProperties.getMessage(resource_error,"OrderProblemGettingProductStoreRecords", locale) + e.getMessage(), module); @@ -4530,7 +4530,7 @@ public class ShoppingCart implements Ite // the products already in the cart GenericValue shippingAddress = null; try { - shippingAddress = item.getDelegator().findByPrimaryKey("PostalAddress", UtilMisc.toMap("contactMechId", this.internalContactMechId)); + shippingAddress = item.getDelegator().findOne("PostalAddress", UtilMisc.toMap("contactMechId", this.internalContactMechId), false); } catch (GenericEntityException gee) { Debug.logError(gee, "Error retrieving the shipping address for contactMechId [" + this.internalContactMechId + "].", module); } @@ -4646,7 +4646,7 @@ public class ShoppingCart implements Ite } try { - return delegator.findByPrimaryKeyCache(entityName, lookupFields); + return delegator.findOne(entityName, lookupFields, true); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -4667,15 +4667,15 @@ public class ShoppingCart implements Ite try { GenericValue pmObj = null; if ("CREDIT_CARD".equals(paymentMethodTypeId)) { - pmObj = delegator.findByPrimaryKey("CreditCard", lookupFields); + pmObj = delegator.findOne("CreditCard", lookupFields, false); } else if ("GIFT_CARD".equals(paymentMethodTypeId)) { - pmObj = delegator.findByPrimaryKey("GiftCard", lookupFields); + pmObj = delegator.findOne("GiftCard", lookupFields, false); } else if ("EFT_ACCOUNT".equals(paymentMethodTypeId)) { - pmObj = delegator.findByPrimaryKey("EftAccount", lookupFields); + pmObj = delegator.findOne("EftAccount", lookupFields, false); } else if ("EXT_BILLACT".equals(paymentMethodTypeId)) { - pmObj = delegator.findByPrimaryKey("BillingAccount", lookupFields); + pmObj = delegator.findOne("BillingAccount", lookupFields, false); } else if ("EXT_PAYPAL".equals(paymentMethodTypeId)) { - pmObj = delegator.findByPrimaryKey("PayPalPaymentMethod", lookupFields); + pmObj = delegator.findOne("PayPalPaymentMethod", lookupFields, false); } if (pmObj != null) { postalAddress = pmObj.getRelatedOne("PostalAddress"); @@ -4718,7 +4718,7 @@ public class ShoppingCart implements Ite GenericValue productStore = null; String splitPayPrefPerShpGrp = null; try { - productStore = delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId", cart.getProductStoreId())); + productStore = delegator.findOne("ProductStore", UtilMisc.toMap("productStoreId", cart.getProductStoreId()), false); } catch (GenericEntityException e) { Debug.logError(e.toString(), module); } Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Sat May 12 21:19:35 2012 @@ -569,7 +569,7 @@ public class ShoppingCartEvents { if(ProductWorker.isAlternativePacking(delegator, productId , parentProductId)){ GenericValue parentProduct = null; try { - parentProduct = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", parentProductId)); + parentProduct = delegator.findOne("Product", UtilMisc.toMap("productId", parentProductId), false); } catch (GenericEntityException e) { Debug.logError(e, "Error getting parent product", module); } @@ -1604,7 +1604,7 @@ public class ShoppingCartEvents { if (UtilValidate.isEmpty(partyId) && UtilValidate.isNotEmpty(userLoginId)) { GenericValue thisUserLogin = null; try { - thisUserLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userLoginId)); + thisUserLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", userLoginId), false); } catch (GenericEntityException gee) { // } @@ -1617,7 +1617,7 @@ public class ShoppingCartEvents { if (UtilValidate.isNotEmpty(partyId)) { GenericValue thisParty = null; try { - thisParty = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId)); + thisParty = delegator.findOne("Party", UtilMisc.toMap("partyId", partyId), false); } catch (GenericEntityException gee) { // } @@ -1673,7 +1673,7 @@ public class ShoppingCartEvents { String productPromoId = (String)context.get(keyPrefix + i); if (UtilValidate.isNotEmpty(productPromoId)) { try { - GenericValue promo = delegator.findByPrimaryKey("ProductPromo", UtilMisc.toMap("productPromoId", productPromoId)); + GenericValue promo = delegator.findOne("ProductPromo", UtilMisc.toMap("productPromoId", productPromoId), false); if (promo != null) { manualPromotions.add(promo); } Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java Sat May 12 21:19:35 2012 @@ -193,7 +193,7 @@ public class ShoppingCartHelper { GenericValue product = null; if (productId != null) { try { - product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId)); + product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), true); } catch (GenericEntityException e) { Debug.logError(e, "Unable to lookup product : " + productId, module); } @@ -328,7 +328,7 @@ public class ShoppingCartHelper { String aggregatedProdId = null; if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", ProductWorker.getProductTypeId(delegator, productId), "parentTypeId", "AGGREGATED")) { try { - GenericValue instanceProduct = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId)); + GenericValue instanceProduct = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false); String configId = instanceProduct.getString("configId"); aggregatedProdId = ProductWorker.getInstanceAggregatedId(delegator, productId); configWrapper = ProductConfigWorker.loadProductConfigWrapper(delegator, dispatcher, configId, aggregatedProdId, cart.getProductStoreId(), catalogId, cart.getWebSiteId(), cart.getCurrency(), cart.getLocale(), cart.getAutoUserLogin()); @@ -431,7 +431,7 @@ public class ShoppingCartHelper { originalProductId = productId; productId = ProductWorker.getOriginalProductId(delegator, productId); try { - originalProduct = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", originalProductId)); + originalProduct = delegator.findOne("Product", UtilMisc.toMap("productId", originalProductId), false); } catch (GenericEntityException e) { Debug.logError(e, "Error getting parent product", module); } @@ -501,7 +501,7 @@ public class ShoppingCartHelper { requirementId = (String) context.get("requirementId" + thisSuffix); GenericValue requirement = null; try { - requirement = delegator.findByPrimaryKey("Requirement", UtilMisc.toMap("requirementId", requirementId)); + requirement = delegator.findOne("Requirement", UtilMisc.toMap("requirementId", requirementId), false); } catch (GenericEntityException gee) { } if (requirement == null) { @@ -972,7 +972,7 @@ public class ShoppingCartHelper { } try { - agreement = this.delegator.findByPrimaryKeyCache("Agreement",UtilMisc.toMap("agreementId", agreementId)); + agreement = this.delegator.findOne("Agreement",UtilMisc.toMap("agreementId", agreementId), true); } catch (GenericEntityException e) { Debug.logWarning(e.toString(), module); result = ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderCouldNotGetAgreement",UtilMisc.toMap("agreementId",agreementId),this.cart.getLocale()) + UtilProperties.getMessage(resource_error,"OrderError",this.cart.getLocale()) + e.getMessage()); Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java Sat May 12 21:19:35 2012 @@ -182,7 +182,7 @@ public class ShoppingCartItem implements GenericValue product = null; try { - product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId)); + product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), true); } catch (GenericEntityException e) { Debug.logWarning(e.toString(), module); } @@ -323,7 +323,7 @@ public class ShoppingCartItem implements GenericValue parentProduct = null; try { - product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId)); + product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), true); // first see if there is a purchase allow category and if this product is in it or not String purchaseProductCategoryId = CatalogWorker.getCatalogPurchaseAllowCategoryId(delegator, prodCatalogId); @@ -351,7 +351,7 @@ public class ShoppingCartItem implements { try { - parentProduct = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", parentProductId)); + parentProduct = delegator.findOne("Product", UtilMisc.toMap("productId", parentProductId), true); } catch (GenericEntityException e) { Debug.logWarning(e.toString(), module); } @@ -952,8 +952,8 @@ public class ShoppingCartItem implements // find an existing Day exception record Timestamp exceptionDateStartTime = new Timestamp((reservStart.getTime() + (dayCount++ * 86400000))); try { - techDataCalendarExcDay = delegator.findByPrimaryKey("TechDataCalendarExcDay", - UtilMisc.toMap("calendarId", fixedAsset.get("calendarId"), "exceptionDateStartTime", exceptionDateStartTime)); + techDataCalendarExcDay = delegator.findOne("TechDataCalendarExcDay", + UtilMisc.toMap("calendarId", fixedAsset.get("calendarId"), "exceptionDateStartTime", exceptionDateStartTime), false); } catch (GenericEntityException e) { Debug.logWarning(e, module); } @@ -1554,7 +1554,7 @@ public class ShoppingCartItem implements /** Returns the item type. */ public GenericValue getItemTypeGenericValue() { try { - return this.getDelegator().findByPrimaryKeyCache("OrderItemType", UtilMisc.toMap("orderItemTypeId", this.itemType)); + return this.getDelegator().findOne("OrderItemType", UtilMisc.toMap("orderItemTypeId", this.itemType), true); } catch (GenericEntityException e) { Debug.logError(e, "Error getting ShippingCartItem's OrderItemType", module); return null; @@ -1587,7 +1587,7 @@ public class ShoppingCartItem implements GenericValue orderItemType = null; if (this.getItemType() != null) { try { - orderItemType = this.getDelegator().findByPrimaryKeyCache("OrderItemType", UtilMisc.toMap("orderItemTypeId", this.getItemType())); + orderItemType = this.getDelegator().findOne("OrderItemType", UtilMisc.toMap("orderItemTypeId", this.getItemType()), true); } catch (GenericEntityException e) { Debug.logWarning(e, UtilProperties.getMessage(resource_error,"OrderProblemsGettingOrderItemTypeFor", UtilMisc.toMap("orderItemTypeId",this.getItemType()), locale)); } @@ -2449,7 +2449,7 @@ public class ShoppingCartItem implements } if (this.productId != null) { try { - this._product = this.getDelegator().findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId)); + this._product = this.getDelegator().findOne("Product", UtilMisc.toMap("productId", productId), true); } catch (GenericEntityException e) { throw new RuntimeException("Entity Engine error getting Product (" + e.getMessage() + ")"); } Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java Sat May 12 21:19:35 2012 @@ -177,7 +177,7 @@ public class ShoppingCartServices { // get the order header GenericValue orderHeader = null; try { - orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); + orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -431,7 +431,7 @@ public class ShoppingCartServices { String workEffortId = orh.getCurrentOrderItemWorkEffort(item); if (workEffortId != null) { try { - workEffort = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId)); + workEffort = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId), false); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -449,7 +449,7 @@ public class ShoppingCartServices { ProductConfigWrapper configWrapper = null; String configId = null; try { - product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId)); + product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false); if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "AGGREGATED")) { List<GenericValue>productAssocs = delegator.findByAnd("ProductAssoc", UtilMisc.toMap("productAssocTypeId", "PRODUCT_CONF", "productIdTo", product.getString("productId"))); productAssocs = EntityUtil.filterByDate(productAssocs); @@ -659,7 +659,7 @@ public class ShoppingCartServices { // get the quote header GenericValue quote = null; try { - quote = delegator.findByPrimaryKey("Quote", UtilMisc.toMap("quoteId", quoteId)); + quote = delegator.findOne("Quote", UtilMisc.toMap("quoteId", quoteId), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -959,7 +959,7 @@ public class ShoppingCartServices { // get the shopping list header GenericValue shoppingList = null; try { - shoppingList = delegator.findByPrimaryKey("ShoppingList", UtilMisc.toMap("shoppingListId", shoppingListId)); + shoppingList = delegator.findOne("ShoppingList", UtilMisc.toMap("shoppingListId", shoppingListId), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java Sat May 12 21:19:35 2012 @@ -102,7 +102,7 @@ public class ProductPromoWorker { String productStoreId = cart.getProductStoreId(); GenericValue productStore = null; try { - productStore = delegator.findByPrimaryKeyCache("ProductStore", UtilMisc.toMap("productStoreId", productStoreId)); + productStore = delegator.findOne("ProductStore", UtilMisc.toMap("productStoreId", productStoreId), true); } catch (GenericEntityException e) { Debug.logError(e, "Error looking up store with id " + productStoreId, module); } @@ -164,7 +164,7 @@ public class ProductPromoWorker { String productStoreId = cart.getProductStoreId(); GenericValue productStore = null; try { - productStore = delegator.findByPrimaryKeyCache("ProductStore", UtilMisc.toMap("productStoreId", productStoreId)); + productStore = delegator.findOne("ProductStore", UtilMisc.toMap("productStoreId", productStoreId), true); } catch (GenericEntityException e) { Debug.logError(e, "Error looking up store with id " + productStoreId, module); } @@ -202,7 +202,7 @@ public class ProductPromoWorker { String productStoreId = cart.getProductStoreId(); GenericValue productStore = null; try { - productStore = delegator.findByPrimaryKeyCache("ProductStore", UtilMisc.toMap("productStoreId", productStoreId)); + productStore = delegator.findOne("ProductStore", UtilMisc.toMap("productStoreId", productStoreId), true); } catch (GenericEntityException e) { Debug.logError(e, "Error looking up store with id " + productStoreId, module); } @@ -245,7 +245,7 @@ public class ProductPromoWorker { String agreementId = cart.getAgreementId(); GenericValue agreement = null; try { - agreement = delegator.findByPrimaryKeyCache("Agreement", UtilMisc.toMap("agreementId", agreementId)); + agreement = delegator.findOne("Agreement", UtilMisc.toMap("agreementId", agreementId), true); } catch (GenericEntityException e) { Debug.logError(e, "Error looking up agreement with id " + agreementId, module); } @@ -575,7 +575,7 @@ public class ProductPromoWorker { public static String checkCanUsePromoCode(String productPromoCodeId, String partyId, Delegator delegator, ShoppingCart cart, Locale locale) { try { - GenericValue productPromoCode = delegator.findByPrimaryKey("ProductPromoCode", UtilMisc.toMap("productPromoCodeId", productPromoCodeId)); + GenericValue productPromoCode = delegator.findOne("ProductPromoCode", UtilMisc.toMap("productPromoCodeId", productPromoCodeId), false); if (productPromoCode == null) { return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_not_valid", UtilMisc.toMap("productPromoCodeId", productPromoCodeId), locale); } @@ -604,7 +604,7 @@ public class ProductPromoWorker { // check partyId if (UtilValidate.isNotEmpty(partyId)) { - if (delegator.findByPrimaryKey("ProductPromoCodeParty", UtilMisc.toMap("productPromoCodeId", productPromoCodeId, "partyId", partyId)) != null) { + if (delegator.findOne("ProductPromoCodeParty", UtilMisc.toMap("productPromoCodeId", productPromoCodeId, "partyId", partyId), false) != null) { // found party associated with the code, looks good... return null; } @@ -688,7 +688,7 @@ public class ProductPromoWorker { if (UtilValidate.isEmpty(messageContext.get("productId"))) messageContext.put("productId", "any"); if (UtilValidate.isEmpty(messageContext.get("partyId"))) messageContext.put("partyId", "any"); - GenericValue product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId)); + GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), true); if (product != null) { messageContext.put("productName", ProductContentWrapper.getProductContentAsText(product, "PRODUCT_NAME", locale, null)); } @@ -1081,8 +1081,8 @@ public class ProductPromoWorker { } else if ("PPIP_ROLE_TYPE".equals(inputParamEnumId)) { if (partyId != null && UtilValidate.isNotEmpty(condValue)) { // if a PartyRole exists for this partyId and the specified roleTypeId - GenericValue partyRole = delegator.findByPrimaryKeyCache("PartyRole", - UtilMisc.toMap("partyId", partyId, "roleTypeId", condValue)); + GenericValue partyRole = delegator.findOne("PartyRole", + UtilMisc.toMap("partyId", partyId, "roleTypeId", condValue), true); // then 0 (equals), otherwise 1 (not equals) if (partyRole != null) { @@ -1195,7 +1195,7 @@ public class ProductPromoWorker { } else if ("PPIP_RECURRENCE".equals(inputParamEnumId)) { if (UtilValidate.isNotEmpty(condValue)) { compareBase = Integer.valueOf(1); - GenericValue recurrenceInfo = delegator.findByPrimaryKeyCache("RecurrenceInfo", UtilMisc.toMap("recurrenceInfoId", condValue)); + GenericValue recurrenceInfo = delegator.findOne("RecurrenceInfo", UtilMisc.toMap("recurrenceInfoId", condValue), true); if (recurrenceInfo != null) { RecurrenceInfo recurrence = null; try { @@ -1416,7 +1416,7 @@ public class ProductPromoWorker { GenericValue product = null; if (UtilValidate.isNotEmpty(productId)) { // Debug.logInfo("======== Got GWP productId [" + productId + "]", module); - product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId)); + product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), true); if (product == null) { String errMsg = "GWP Product not found with ID [" + productId + "] for ProductPromoAction [" + productPromoAction.get("productPromoId") + ":" + productPromoAction.get("productPromoRuleId") + ":" + productPromoAction.get("productPromoActionSeqId") + "]"; Debug.logError(errMsg, module); @@ -1504,7 +1504,7 @@ public class ProductPromoWorker { } optionProductIds.remove(alternateGwpProductId); productId = alternateGwpProductId; - product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId)); + product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), true); } else { Debug.logWarning(UtilProperties.getMessage(resource_error,"OrderAnAlternateGwpProductIdWasInPlaceButWasEitherNotValidOrIsNoLongerInStockForId", UtilMisc.toMap("alternateGwpProductId",alternateGwpProductId), cart.getLocale()), module); } @@ -1516,7 +1516,7 @@ public class ProductPromoWorker { Iterator<String> optionProductIdTempIter = optionProductIds.iterator(); productId = optionProductIdTempIter.next(); optionProductIdTempIter.remove(); - product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId)); + product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), true); } if (product == null) { @@ -1889,7 +1889,7 @@ public class ProductPromoWorker { // get the promoText / promoName to set as a descr of the orderAdj GenericValue prodPromo; try { - prodPromo = delegator.findByPrimaryKeyCache("ProductPromo", UtilMisc.toMap("productPromoId", prodPromoId)); + prodPromo = delegator.findOne("ProductPromo", UtilMisc.toMap("productPromoId", prodPromoId), true); if (UtilValidate.isNotEmpty(prodPromo.get("promoText"))) { return (String) prodPromo.get("promoText"); } @@ -2017,7 +2017,7 @@ public class ProductPromoWorker { } protected static boolean isProductOld(String productId, Delegator delegator, Timestamp nowTimestamp) throws GenericEntityException { - GenericValue product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId)); + GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), true); if (product != null) { Timestamp salesDiscontinuationDate = product.getTimestamp("salesDiscontinuationDate"); if (salesDiscontinuationDate != null && salesDiscontinuationDate.before(nowTimestamp)) { Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java Sat May 12 21:19:35 2012 @@ -213,7 +213,7 @@ public class ShoppingListEvents { GenericValue shoppingList = null; List<GenericValue> shoppingListItems = null; try { - shoppingList = delegator.findByPrimaryKey("ShoppingList", UtilMisc.toMap("shoppingListId", shoppingListId)); + shoppingList = delegator.findOne("ShoppingList", UtilMisc.toMap("shoppingListId", shoppingListId), false); if (shoppingList == null) { errMsg = UtilProperties.getMessage(resource_error,"shoppinglistevents.error_getting_shopping_list_and_items", cart.getLocale()); throw new IllegalArgumentException(errMsg); @@ -403,7 +403,7 @@ public class ShoppingListEvents { autoSaveListId = getAutoSaveListId(delegator, dispatcher, null, userLogin, cart.getProductStoreId()); cart.setAutoSaveListId(autoSaveListId); } - GenericValue shoppingList = delegator.findByPrimaryKey("ShoppingList", UtilMisc.toMap("shoppingListId", autoSaveListId)); + GenericValue shoppingList = delegator.findOne("ShoppingList", UtilMisc.toMap("shoppingListId", autoSaveListId), false); Integer currentListSize = 0; if (UtilValidate.isNotEmpty(shoppingList)) { List<GenericValue> shoppingListItems = shoppingList.getRelated("ShoppingListItem"); @@ -504,7 +504,7 @@ public class ShoppingListEvents { if (!okayToLoad && lastLoad != null) { GenericValue shoppingList = null; try { - shoppingList = delegator.findByPrimaryKey("ShoppingList", UtilMisc.toMap("shoppingListId", autoSaveListId)); + shoppingList = delegator.findOne("ShoppingList", UtilMisc.toMap("shoppingListId", autoSaveListId), false); } catch (GenericEntityException e) { Debug.logError(e, module); } Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java Sat May 12 21:19:35 2012 @@ -271,7 +271,7 @@ public class ShoppingListServices { beganTransaction = TransactionUtil.begin(); GenericValue orderHeader = null; - orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); + orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false); if (orderHeader == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderUnableToLocateOrder", UtilMisc.toMap("orderId",orderId), locale)); @@ -312,7 +312,7 @@ public class ShoppingListServices { } GenericValue shoppingList = null; - shoppingList = delegator.findByPrimaryKey("ShoppingList", UtilMisc.toMap("shoppingListId", shoppingListId)); + shoppingList = delegator.findOne("ShoppingList", UtilMisc.toMap("shoppingListId", shoppingListId), false); if (shoppingList == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderNoShoppingListAvailable",locale)); @@ -332,7 +332,7 @@ public class ShoppingListServices { orderItem.get("productId"), "quantity", orderItem.get("quantity")); if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", ProductWorker.getProductTypeId(delegator, productId), "parentTypeId", "AGGREGATED")) { try { - GenericValue instanceProduct = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId)); + GenericValue instanceProduct = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false); String configId = instanceProduct.getString("configId"); ctx.put("configId", configId); String aggregatedProductId = ProductWorker.getInstanceAggregatedId(delegator, productId); @@ -536,7 +536,7 @@ public class ShoppingListServices { Delegator delegator = dispatcher.getDelegator(); GenericValue shoppingList = null; try { - shoppingList = delegator.findByPrimaryKey("ShoppingList", UtilMisc.toMap("shoppingListId", shoppingListId)); + shoppingList = delegator.findOne("ShoppingList", UtilMisc.toMap("shoppingListId", shoppingListId), false); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -563,8 +563,8 @@ public class ShoppingListServices { String shoppingListId = orderItem.getString("shoppingListId"); String shoppingListItemSeqId = orderItem.getString("shoppingListItemSeqId"); if (UtilValidate.isNotEmpty(shoppingListId)) { - GenericValue shoppingListItem=delegator.findByPrimaryKey("ShoppingListItem", UtilMisc.toMap("shoppingListId", - shoppingListId, "shoppingListItemSeqId", shoppingListItemSeqId)); + GenericValue shoppingListItem=delegator.findOne("ShoppingListItem", UtilMisc.toMap("shoppingListId", + shoppingListId, "shoppingListItemSeqId", shoppingListItemSeqId), false); if (shoppingListItem != null) { BigDecimal quantityPurchased = shoppingListItem.getBigDecimal("quantityPurchased"); BigDecimal orderQuantity = orderItem.getBigDecimal("quantity"); Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/task/TaskWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/task/TaskWorker.java?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/task/TaskWorker.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/task/TaskWorker.java Sat May 12 21:19:35 2012 @@ -64,7 +64,7 @@ public class TaskWorker { GenericValue role = null; try { Map<String, ? extends Object> pkFields = UtilMisc.toMap("roleTypeId", orderTaskList.getString("roleTypeId")); - role = orderTaskList.getDelegator().findByPrimaryKey("RoleType", pkFields); + role = orderTaskList.getDelegator().findOne("RoleType", pkFields, false); } catch (GenericEntityException e) { Debug.logError(e, "Cannot get RoleType entity value", module); return orderTaskList.getString("roleTypeId"); Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/test/PurchaseOrderTest.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/test/PurchaseOrderTest.java?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/test/PurchaseOrderTest.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/test/PurchaseOrderTest.java Sat May 12 21:19:35 2012 @@ -41,7 +41,7 @@ public class PurchaseOrderTest extends O @Override protected void setUp() throws Exception { - userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system")); + userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", "system"), false); } @Override Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/test/SalesOrderTest.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/test/SalesOrderTest.java?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/test/SalesOrderTest.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/test/SalesOrderTest.java Sat May 12 21:19:35 2012 @@ -39,7 +39,7 @@ public class SalesOrderTest extends OFBi @Override protected void setUp() throws Exception { - userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system")); + userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", "system"), false); } @Override Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AdditionalPartyListing.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AdditionalPartyListing.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AdditionalPartyListing.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AdditionalPartyListing.groovy Sat May 12 21:19:35 2012 @@ -29,12 +29,12 @@ roleData = [:]; partyData = [:]; additionalPartyRole.each { roleTypeId, partyList -> - roleData[roleTypeId] = delegator.findByPrimaryKeyCache("RoleType", [roleTypeId : roleTypeId]); + roleData[roleTypeId] = delegator.findOne("RoleType", [roleTypeId : roleTypeId], true); partyList.each { partyId -> partyMap = [:]; partyMap.partyId = partyId; - party = delegator.findByPrimaryKeyCache("Party", [partyId : partyId]); + party = delegator.findOne("Party", [partyId : partyId], true); if (party.partyTypeId.equals("PERSON")) { party = party.getRelatedOneCache("Person"); partyMap.type = "person"; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/BillSettings.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/BillSettings.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/BillSettings.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/BillSettings.groovy Sat May 12 21:19:35 2012 @@ -41,7 +41,7 @@ if (newPaymentMethodId) { } if (orderPartyId && !orderPartyId.equals("_NA_")) { - orderParty = delegator.findByPrimaryKey("Party", [partyId : orderPartyId]); + orderParty = delegator.findOne("Party", [partyId : orderPartyId], false); orderPerson = orderParty.getRelatedOne("Person"); context.orderParty = orderParty; context.orderPerson = orderPerson; @@ -58,7 +58,7 @@ if (orderPartyId && !orderPartyId.equals if (request.getParameter("useShipAddr") && cart.getShippingContactMechId()) { shippingContactMech = cart.getShippingContactMechId(); - postalAddress = delegator.findByPrimaryKey("PostalAddress", [contactMechId : shippingContactMech]); + postalAddress = delegator.findOne("PostalAddress", [contactMechId : shippingContactMech], false); context.postalFields = postalAddress; } else { context.postalFields = UtilHttp.getParameterMap(request); @@ -69,7 +69,7 @@ if (cart) { checkOutPaymentId = cart.getPaymentMethodIds().get(0); context.checkOutPaymentId = checkOutPaymentId; if (!orderParty) { - paymentMethod = delegator.findByPrimaryKey("PaymentMethod", [paymentMethodId : checkOutPaymentId]); + paymentMethod = delegator.findOne("PaymentMethod", [paymentMethodId : checkOutPaymentId], false); if ("CREDIT_CARD".equals(paymentMethod?.paymentMethodTypeId)) { paymentMethodType = "CC"; account = paymentMethod.getRelatedOne("CreditCard"); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy Sat May 12 21:19:35 2012 @@ -34,7 +34,7 @@ productStore = ProductStoreWorker.getPro if (productStore) { context.defaultProductStore = productStore; if (productStore.defaultSalesChannelEnumId) - context.defaultSalesChannel = delegator.findByPrimaryKeyCache("Enumeration", [enumId : productStore.defaultSalesChannelEnumId]); + context.defaultSalesChannel = delegator.findOne("Enumeration", [enumId : productStore.defaultSalesChannelEnumId], true); } // Get the Cart shoppingCart = session.getAttribute("shoppingCart"); @@ -56,7 +56,7 @@ context.organizations = organizations; partyId = null; partyId = parameters.partyId; if (partyId) { - party = delegator.findByPrimaryKey("Person", [partyId : partyId]); + party = delegator.findOne("Person", [partyId : partyId], false); contactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false)); if (contactMech) { ShoppingCart shoppingCart = ShoppingCartEvents.getCartObject(request); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutOptions.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutOptions.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutOptions.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutOptions.groovy Sat May 12 21:19:35 2012 @@ -28,7 +28,7 @@ import org.ofbiz.order.shoppingcart.ship shoppingCart = session.getAttribute("shoppingCart"); currencyUomId = shoppingCart.getCurrency(); partyId = shoppingCart.getPartyId(); -party = delegator.findByPrimaryKeyCache("Party", [partyId : partyId]); +party = delegator.findOne("Party", [partyId : partyId], true); productStore = ProductStoreWorker.getProductStore(request); shippingEstWpr = null; @@ -40,14 +40,14 @@ if (shoppingCart) { shoppingCart.createDropShipGroups(dispatcher); } -profiledefs = delegator.findByPrimaryKey("PartyProfileDefault", [partyId : userLogin.partyId, productStoreId : productStoreId]); +profiledefs = delegator.findOne("PartyProfileDefault", [partyId : userLogin.partyId, productStoreId : productStoreId], false); context.profiledefs = profiledefs; context.shoppingCart = shoppingCart; context.userLogin = userLogin; context.productStoreId = productStore.get("productStoreId"); context.productStore = productStore; -shipToParty = delegator.findByPrimaryKeyCache("Party", [partyId : shoppingCart.getShipToCustomerPartyId()]); +shipToParty = delegator.findOne("Party", [partyId : shoppingCart.getShipToCustomerPartyId()], true); context.shippingContactMechList = ContactHelper.getContactMech(shipToParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); context.emailList = ContactHelper.getContactMechByType(party, "EMAIL_ADDRESS", false); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy Sat May 12 21:19:35 2012 @@ -28,7 +28,7 @@ cart = session.getAttribute("shoppingCar currencyUomId = cart.getCurrency(); userLogin = session.getAttribute("userLogin"); partyId = cart.getPartyId(); -party = delegator.findByPrimaryKeyCache("Party", [partyId : partyId]); +party = delegator.findOne("Party", [partyId : partyId], true); productStoreId = ProductStoreWorker.getProductStoreId(request); checkOutPaymentId = ""; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutReview.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutReview.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutReview.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutReview.groovy Sat May 12 21:19:35 2012 @@ -86,7 +86,7 @@ paymentMethodType = null; paymentMethodTypeId = null; if (paymentMethodTypeIds) { paymentMethodTypeId = paymentMethodTypeIds.get(0); - paymentMethodType = delegator.findByPrimaryKey("PaymentMethodType", [paymentMethodTypeId : paymentMethodTypeId]); + paymentMethodType = delegator.findOne("PaymentMethodType", [paymentMethodTypeId : paymentMethodTypeId], false); context.paymentMethodType = paymentMethodType; } @@ -106,7 +106,7 @@ if (paymentMethod) { } if (billingAddress) context.billingAddress = billingAddress; -billingAccount = cart.getBillingAccountId() ? delegator.findByPrimaryKey("BillingAccount", [billingAccountId : cart.getBillingAccountId()]) : null; +billingAccount = cart.getBillingAccountId() ? delegator.findOne("BillingAccount", [billingAccountId : cart.getBillingAccountId()], false) : null; if (billingAccount) context.billingAccount = billingAccount; context.customerPoNumber = cart.getPoNumber(); @@ -119,7 +119,7 @@ context.isGift = cart.getIsGift(); context.shipBeforeDate = cart.getShipBeforeDate(); context.shipAfterDate = cart.getShipAfterDate(); -shipmentMethodType = delegator.findByPrimaryKey("ShipmentMethodType", [shipmentMethodTypeId : cart.getShipmentMethodTypeId()]); +shipmentMethodType = delegator.findOne("ShipmentMethodType", [shipmentMethodTypeId : cart.getShipmentMethodTypeId()], false); if (shipmentMethodType) context.shipMethDescription = shipmentMethodType.description; orh = new OrderReadHelper(orderAdjustments, orderItems); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy Sat May 12 21:19:35 2012 @@ -39,7 +39,7 @@ request.removeAttribute("_EVENT_MESSAGE_ party = null; orderPartyIdId = cart.getPartyId(); if (orderPartyIdId) { - orderPartyId = delegator.findByPrimaryKey("Party", [partyId : orderPartyIdId]); + orderPartyId = delegator.findOne("Party", [partyId : orderPartyIdId], false); context.orderPartyId = orderPartyId; } Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy Sat May 12 21:19:35 2012 @@ -46,7 +46,7 @@ request.removeAttribute("_EVENT_MESSAGE_ if ("SALES_ORDER".equals(cart.getOrderType())) { if (!"_NA_".equals(orderPartyId)) { - orderParty = delegator.findByPrimaryKey("Party", [partyId : orderPartyId]); + orderParty = delegator.findOne("Party", [partyId : orderPartyId], false); if (orderParty) { shippingContactMechList = ContactHelper.getContactMech(orderParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); orderPerson = orderParty.getRelatedOne("Person"); @@ -57,7 +57,7 @@ if ("SALES_ORDER".equals(cart.getOrderTy } // Ship to another party if (shipToPartyId) { - shipToParty = delegator.findByPrimaryKey("Party", [partyId : shipToPartyId]); + shipToParty = delegator.findOne("Party", [partyId : shipToPartyId], false); if (shipToParty) { context.shipToParty = shipToParty; shipToPartyShippingContactMechList = ContactHelper.getContactMech(shipToParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); @@ -74,7 +74,7 @@ if ("SALES_ORDER".equals(cart.getOrderTy } else { // Purchase order if (!"_NA_".equals(orderPartyId)) { - orderParty = delegator.findByPrimaryKey("Party", [partyId : orderPartyId]); + orderParty = delegator.findOne("Party", [partyId : orderPartyId], false); if (orderParty) { orderPerson = orderParty.getRelatedOne("Person"); context.orderParty = orderParty; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy Sat May 12 21:19:35 2012 @@ -87,7 +87,7 @@ if (partyId) { } // get product inventory summary for each shopping cart item -productStore = delegator.findByPrimaryKeyCache("ProductStore", [productStoreId : productStoreId]); +productStore = delegator.findOne("ProductStore", [productStoreId : productStoreId], true); context.productStore = productStore productStoreFacilityId = null; if (productStore) { Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/ShowPromotionDetails.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/ShowPromotionDetails.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/ShowPromotionDetails.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/ShowPromotionDetails.groovy Sat May 12 21:19:35 2012 @@ -23,7 +23,7 @@ import org.ofbiz.order.shoppingcart.prod productPromoId = request.getParameter("productPromoId"); if (!productPromoId) productPromoId = parameters.productPromoId; -productPromo = delegator.findByPrimaryKey("ProductPromo", [productPromoId : productPromoId]); +productPromo = delegator.findOne("ProductPromo", [productPromoId : productPromoId], false); promoAutoDescription = ProductPromoWorker.makeAutoDescription(productPromo, delegator, locale); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/AdvancedSearchOptions.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/AdvancedSearchOptions.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/AdvancedSearchOptions.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/AdvancedSearchOptions.groovy Sat May 12 21:19:35 2012 @@ -34,7 +34,7 @@ if (!searchCategoryId) { currentCatalogId = CatalogWorker.getCurrentCatalogId(request); searchCategoryId = CatalogWorker.getCatalogSearchCategoryId(request, currentCatalogId); } -searchCategory = delegator.findByPrimaryKey("ProductCategory", [productCategoryId : searchCategoryId]); +searchCategory = delegator.findOne("ProductCategory", [productCategoryId : searchCategoryId], false); productFeaturesByTypeMap = ParametricSearch.makeCategoryFeatureLists(searchCategoryId, delegator); productFeatureTypeIdsOrdered = new TreeSet(productFeaturesByTypeMap.keySet()) as List; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy Sat May 12 21:19:35 2012 @@ -57,22 +57,22 @@ if (productCategoryId) { } */ -category = delegator.findByPrimaryKeyCache("ProductCategory", [productCategoryId : productCategoryId]); +category = delegator.findOne("ProductCategory", [productCategoryId : productCategoryId], true); if (category) { if (category.detailScreen) { detailScreen = category.detailScreen; } categoryPageTitle = delegator.findByAndCache("ProductCategoryContentAndInfo", [productCategoryId : productCategoryId, prodCatContentTypeId : "PAGE_TITLE"]); if (categoryPageTitle) { - pageTitle = delegator.findByPrimaryKeyCache("ElectronicText", [dataResourceId : categoryPageTitle.get(0).dataResourceId]); + pageTitle = delegator.findOne("ElectronicText", [dataResourceId : categoryPageTitle.get(0).dataResourceId], true); } categoryMetaDescription = delegator.findByAndCache("ProductCategoryContentAndInfo", [productCategoryId : productCategoryId, prodCatContentTypeId : "META_DESCRIPTION"]); if (categoryMetaDescription) { - metaDescription = delegator.findByPrimaryKeyCache("ElectronicText", [dataResourceId : categoryMetaDescription.get(0).dataResourceId]); + metaDescription = delegator.findOne("ElectronicText", [dataResourceId : categoryMetaDescription.get(0).dataResourceId], true); } categoryMetaKeywords = delegator.findByAndCache("ProductCategoryContentAndInfo", [productCategoryId : productCategoryId, prodCatContentTypeId : "META_KEYWORD"]); if (categoryMetaKeywords) { - metaKeywords = delegator.findByPrimaryKeyCache("ElectronicText", [dataResourceId : categoryMetaKeywords.get(0).dataResourceId]); + metaKeywords = delegator.findOne("ElectronicText", [dataResourceId : categoryMetaKeywords.get(0).dataResourceId], true); } categoryContentWrapper = new CategoryContentWrapper(category, request); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CategoryDetail.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CategoryDetail.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CategoryDetail.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CategoryDetail.groovy Sat May 12 21:19:35 2012 @@ -70,7 +70,7 @@ if(productStore) { if("N".equals(productStore.showOutOfStockProducts)) { productsInStock = []; productCategoryMembers.each { productCategoryMember -> - product = delegator.findByPrimaryKeyCache("Product", [productId : productCategoryMember.productId]); + product = delegator.findOne("Product", [productId : productCategoryMember.productId], true); boolean isMarketingPackage = EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.productTypeId, "parentTypeId", "MARKETING_PKG"); context.isMarketingPackage = (isMarketingPackage? "true": "false"); if (isMarketingPackage) { Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/InlineProductDetail.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/InlineProductDetail.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/InlineProductDetail.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/InlineProductDetail.groovy Sat May 12 21:19:35 2012 @@ -46,7 +46,7 @@ catalogName = CatalogWorker.getCatalogNa currentCatalogId = CatalogWorker.getCurrentCatalogId(request); if (inlineProductId) { - inlineProduct = delegator.findByPrimaryKeyCache("Product", [productId : inlineProductId]); + inlineProduct = delegator.findOne("Product", [productId : inlineProductId], true); if (inlineProduct) { context.product = inlineProduct; contentWrapper = new ProductContentWrapper(inlineProduct, request); @@ -175,7 +175,7 @@ if (inlineProduct) { if (variantTree) { featureOrder = new LinkedList(featureSet); featureOrder.each { featureKey -> - featureValue = delegator.findByPrimaryKeyCache("ProductFeatureType", [productFeatureTypeId : featureKey]); + featureValue = delegator.findOne("ProductFeatureType", [productFeatureTypeId : featureKey], true); fValue = featureValue.get("description") ?: featureValue.productFeatureTypeId; featureTypes[featureKey] = fValue; } Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy Sat May 12 21:19:35 2012 @@ -42,7 +42,7 @@ metaKeywords = null; // get the product entity if (productId) { - product = delegator.findByPrimaryKeyCache("Product", [productId : productId]); + product = delegator.findOne("Product", [productId : productId], true); if (product) { // first make sure this isn't a virtual-variant that has an associated virtual product, if it does show that instead of the variant if("Y".equals(product.isVirtual) && "Y".equals(product.isVariant)){ @@ -59,20 +59,20 @@ if (productId) { virtualProductId = ProductWorker.getVariantVirtualId(product); if (virtualProductId) { productId = virtualProductId; - product = delegator.findByPrimaryKeyCache("Product", [productId : productId]); + product = delegator.findOne("Product", [productId : productId], true); } productPageTitle = delegator.findByAndCache("ProductContentAndInfo", [productId : productId, productContentTypeId : "PAGE_TITLE"]); if (productPageTitle) { - pageTitle = delegator.findByPrimaryKeyCache("ElectronicText", [dataResourceId : productPageTitle.get(0).dataResourceId]); + pageTitle = delegator.findOne("ElectronicText", [dataResourceId : productPageTitle.get(0).dataResourceId], true); } productMetaDescription = delegator.findByAndCache("ProductContentAndInfo", [productId : productId, productContentTypeId : "META_DESCRIPTION"]); if (productMetaDescription) { - metaDescription = delegator.findByPrimaryKeyCache("ElectronicText", [dataResourceId : productMetaDescription.get(0).dataResourceId]); + metaDescription = delegator.findOne("ElectronicText", [dataResourceId : productMetaDescription.get(0).dataResourceId], true); } productMetaKeywords = delegator.findByAndCache("ProductContentAndInfo", [productId : productId, productContentTypeId : "META_KEYWORD"]); if (productMetaKeywords) { - metaKeywords = delegator.findByPrimaryKeyCache("ElectronicText", [dataResourceId : productMetaKeywords.get(0).dataResourceId]); + metaKeywords = delegator.findOne("ElectronicText", [dataResourceId : productMetaKeywords.get(0).dataResourceId], true); } context.productId = productId; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy Sat May 12 21:19:35 2012 @@ -209,14 +209,14 @@ if (product) { if (cart.isSalesOrder()) { facilityId = productStore.inventoryFacilityId; /* - productFacility = delegator.findByPrimaryKeyCache("ProductFacility", [productId : productId, facilityId : facilityId); + productFacility = delegator.findOne("ProductFacility", [productId : productId, facilityId : facilityId, true); context.daysToShip = productFacility?.daysToShip */ resultOutput = dispatcher.runSync("getInventoryAvailableByFacility", [productId : productId, facilityId : facilityId, useCache : false]); totalAvailableToPromise = resultOutput.availableToPromiseTotal; if (totalAvailableToPromise) { - productFacility = delegator.findByPrimaryKeyCache("ProductFacility", [productId : productId, facilityId : facilityId]); + productFacility = delegator.findOne("ProductFacility", [productId : productId, facilityId : facilityId], true); context.daysToShip = productFacility?.daysToShip } } else { @@ -294,7 +294,7 @@ if (product) { if (variantTree) { featureOrder = new LinkedList(featureSet); featureOrder.each { featureKey -> - featureValue = delegator.findByPrimaryKeyCache("ProductFeatureType", [productFeatureTypeId : featureKey]); + featureValue = delegator.findOne("ProductFeatureType", [productFeatureTypeId : featureKey], true); fValue = featureValue.get("description") ?: featureValue.productFeatureTypeId; featureTypes[featureKey] = fValue; } @@ -619,7 +619,7 @@ if (product) { continue; } // filter out all variants - commonProduct = delegator.findByPrimaryKeyCache("Product", [productId : commonFeatureResultId]); + commonProduct = delegator.findOne("Product", [productId : commonFeatureResultId], true); if ("Y".equals(commonProduct?.isVariant)) { continue; } @@ -645,9 +645,9 @@ if (product) { contentAssocThumbList = delegator.findByAnd("ContentAssoc", [contentId : productContentAndInfoImageManament.contentId, contentAssocTypeId : "IMAGE_THUMBNAIL"]); contentAssocThumb = EntityUtil.getFirst(contentAssocThumbList); if(contentAssocThumb) { - imageContentThumb = delegator.findByPrimaryKey("Content", [contentId : contentAssocThumb.contentIdTo]); + imageContentThumb = delegator.findOne("Content", [contentId : contentAssocThumb.contentIdTo], false); if(imageContentThumb) { - productImageThumb = delegator.findByPrimaryKey("ContentDataResourceView", [contentId : imageContentThumb.contentId, drDataResourceId : imageContentThumb.dataResourceId]); + productImageThumb = delegator.findOne("ContentDataResourceView", [contentId : imageContentThumb.contentId, drDataResourceId : imageContentThumb.dataResourceId], false); productImageMap = [:]; productImageMap.productImageThumb = productImageThumb.drObjectInfo; productImageMap.productImage = productContentAndInfoImageManament.drObjectInfo; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductSummary.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductSummary.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductSummary.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductSummary.groovy Sat May 12 21:19:35 2012 @@ -61,7 +61,7 @@ context.remove("totalPrice"); // get the product entity if (!product && productId) { - product = delegator.findByPrimaryKeyCache("Product", [productId : productId]); + product = delegator.findOne("Product", [productId : productId], true); } if (product) { //if order is purchase then don't calculate available inventory for product. @@ -69,7 +69,7 @@ if (product) { resultOutput = dispatcher.runSync("getInventoryAvailableByFacility", [productId : product.productId, facilityId : facilityId, useCache : true]); totalAvailableToPromise = resultOutput.availableToPromiseTotal; if (totalAvailableToPromise && totalAvailableToPromise.doubleValue() > 0) { - productFacility = delegator.findByPrimaryKeyCache("ProductFacility", [productId : product.productId, facilityId : facilityId]); + productFacility = delegator.findOne("ProductFacility", [productId : product.productId, facilityId : facilityId], true); if (productFacility?.daysToShip != null) { context.daysToShip = productFacility.daysToShip; } Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductUomDropDownOnly.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductUomDropDownOnly.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductUomDropDownOnly.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductUomDropDownOnly.groovy Sat May 12 21:19:35 2012 @@ -19,7 +19,7 @@ import org.ofbiz.base.util.*; -product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", parameters.productId)); +product = delegator.findOne("Product", UtilMisc.toMap("productId", parameters.productId), false); if (product) { productVirtualVariants = delegator.findByAndCache("ProductAssoc", UtilMisc.toMap("productIdTo", product.productId , "productAssocTypeId", "ALTERNATIVE_PACKAGE")); if(productVirtualVariants){ Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/QuickAdd.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/QuickAdd.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/QuickAdd.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/QuickAdd.groovy Sat May 12 21:19:35 2012 @@ -45,6 +45,6 @@ if (categoryId) { context[key] = value; } } - productCategory = delegator.findByPrimaryKey("ProductCategory", ["productCategoryId" : categoryId]); + productCategory = delegator.findOne("ProductCategory", ["productCategoryId" : categoryId], false); context.productCategory = productCategory; } Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy Sat May 12 21:19:35 2012 @@ -41,22 +41,22 @@ quoteId = parameters.quoteId; fromPartyId = parameters.fromPartyId; if (!orderHeader && orderId) { - orderHeader = delegator.findByPrimaryKey("OrderHeader", [orderId : orderId]); + orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false); } else if (shipmentId) { - shipment = delegator.findByPrimaryKey("Shipment", [shipmentId : shipmentId]); + shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false); orderHeader = shipment.getRelatedOne("PrimaryOrderHeader"); } if (!invoice && invoiceId) { - invoice = delegator.findByPrimaryKey("Invoice", [invoiceId : invoiceId]); + invoice = delegator.findOne("Invoice", [invoiceId : invoiceId], false); } if (!returnHeader && returnId) { - returnHeader = delegator.findByPrimaryKey("ReturnHeader", [returnId : returnId]); + returnHeader = delegator.findOne("ReturnHeader", [returnId : returnId], false); } if (quoteId) { - quote = delegator.findByPrimaryKey("Quote", [quoteId : quoteId]); + quote = delegator.findOne("Quote", [quoteId : quoteId], false); } // defaults: @@ -118,7 +118,7 @@ if (!partyId) { } // the logo -partyGroup = delegator.findByPrimaryKey("PartyGroup", [partyId : partyId]); +partyGroup = delegator.findOne("PartyGroup", [partyId : partyId], false); if (partyGroup) { partyContentWrapper = new PartyContentWrapper(dispatcher, partyGroup, locale, "text/html"); partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator); @@ -144,7 +144,7 @@ addresses = delegator.findByAnd("PartyCo selAddresses = EntityUtil.filterByDate(addresses, nowTimestamp, "fromDate", "thruDate", true); address = null; if (selAddresses) { - address = delegator.findByPrimaryKey("PostalAddress", [contactMechId : selAddresses[0].contactMechId]); + address = delegator.findOne("PostalAddress", [contactMechId : selAddresses[0].contactMechId], false); } if (address) { // get the country name and state/province abbreviation @@ -163,7 +163,7 @@ context.postalAddress = address; phones = delegator.findByAnd("PartyContactMechPurpose", [partyId : partyId, contactMechPurposeTypeId : "PRIMARY_PHONE"]); selPhones = EntityUtil.filterByDate(phones, nowTimestamp, "fromDate", "thruDate", true); if (selPhones) { - context.phone = delegator.findByPrimaryKey("TelecomNumber", [contactMechId : selPhones[0].contactMechId]); + context.phone = delegator.findOne("TelecomNumber", [contactMechId : selPhones[0].contactMechId], false); } // Fax @@ -177,7 +177,7 @@ if (faxNumbers) { emails = delegator.findByAnd("PartyContactMechPurpose", [partyId : partyId, contactMechPurposeTypeId : "PRIMARY_EMAIL"]); selEmails = EntityUtil.filterByDate(emails, nowTimestamp, "fromDate", "thruDate", true); if (selEmails) { - context.email = delegator.findByPrimaryKey("ContactMech", [contactMechId : selEmails[0].contactMechId]); + context.email = delegator.findOne("ContactMech", [contactMechId : selEmails[0].contactMechId], false); } else { //get email address from party contact mech contacts = delegator.findByAnd("PartyContactMech", [partyId : partyId]); selContacts = EntityUtil.filterByDate(contacts, nowTimestamp, "fromDate", "thruDate", true); @@ -217,7 +217,7 @@ if (selContacts) { paymentMethods = delegator.findByAnd("PaymentMethod", [partyId : partyId, paymentMethodTypeId : "EFT_ACCOUNT"]); selPayments = EntityUtil.filterByDate(paymentMethods, nowTimestamp, "fromDate", "thruDate", true); if (selPayments) { - context.eftAccount = delegator.findByPrimaryKey("EftAccount", [paymentMethodId : selPayments[0].paymentMethodId]); + context.eftAccount = delegator.findOne("EftAccount", [paymentMethodId : selPayments[0].paymentMethodId], false); } // Tax ID Info Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/FindOrders.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/FindOrders.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/FindOrders.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/FindOrders.groovy Sat May 12 21:19:35 2012 @@ -59,34 +59,34 @@ context.paymentStatusList = paymentStatu // current role type currentRoleTypeId = request.getParameter("roleTypeId"); if (currentRoleTypeId) { - currentRole = delegator.findByPrimaryKeyCache("RoleType", [roleTypeId : currentRoleTypeId]); + currentRole = delegator.findOne("RoleType", [roleTypeId : currentRoleTypeId], true); context.currentRole = currentRole; } // current selected type currentTypeId = request.getParameter("orderTypeId"); if (currentTypeId) { - currentType = delegator.findByPrimaryKeyCache("OrderType", [orderTypeId : currentTypeId]); + currentType = delegator.findOne("OrderType", [orderTypeId : currentTypeId], true); context.currentType = currentType; } // current selected status currentStatusId = request.getParameter("orderStatusId"); if (currentStatusId) { - currentStatus = delegator.findByPrimaryKeyCache("StatusItem", [statusId : currentStatusId]); + currentStatus = delegator.findOne("StatusItem", [statusId : currentStatusId], true); context.currentStatus = currentStatus; } // current website currentWebSiteId = request.getParameter("orderWebSiteId"); if (currentWebSiteId) { - currentWebSite = delegator.findByPrimaryKeyCache("WebSite", [webSiteId : currentWebSiteId]); + currentWebSite = delegator.findOne("WebSite", [webSiteId : currentWebSiteId], true); context.currentWebSite = currentWebSite; } // current store currentProductStoreId = request.getParameter("productStoreId"); if (currentProductStoreId) { - currentProductStore = delegator.findByPrimaryKeyCache("ProductStore", [productStoreId : currentProductStoreId]); + currentProductStore = delegator.findOne("ProductStore", [productStoreId : currentProductStoreId], true); context.currentProductStore = currentProductStore; } @@ -104,7 +104,7 @@ if (shipmentMethod) { // current channel currentSalesChannelId = request.getParameter("salesChannelEnumId"); if (currentSalesChannelId) { - currentSalesChannel = delegator.findByPrimaryKey("Enumeration", [enumId : currentSalesChannelId]); + currentSalesChannel = delegator.findOne("Enumeration", [enumId : currentSalesChannelId], false); context.currentSalesChannel = currentSalesChannel; } Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderDeliveryScheduleInfo.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderDeliveryScheduleInfo.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderDeliveryScheduleInfo.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderDeliveryScheduleInfo.groovy Sat May 12 21:19:35 2012 @@ -23,13 +23,13 @@ import org.ofbiz.widget.html.*; orderId = request.getParameter("orderId"); orderTypeId = null; -orderHeader = delegator.findByPrimaryKey("OrderHeader", [orderId : orderId]); +orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false); if (orderHeader) { orderTypeId = orderHeader.orderTypeId; } //Determine whether a schedule has already been defined for this PO -schedule = delegator.findByPrimaryKey("OrderDeliverySchedule", [orderId : orderId, orderItemSeqId : "_NA_"]); +schedule = delegator.findOne("OrderDeliverySchedule", [orderId : orderId, orderItemSeqId : "_NA_"], false); // Determine whether the current user can VIEW the order checkMap = [orderId : orderId, userLogin : session.getAttribute("userLogin"), checkAction : "VIEW"]; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderHistory.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderHistory.groovy?rev=1337669&r1=1337668&r2=1337669&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderHistory.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderHistory.groovy Sat May 12 21:19:35 2012 @@ -25,7 +25,7 @@ context.orderId = orderId; orderHeader = null; if (orderId) { - orderHeader = delegator.findByPrimaryKey("OrderHeader", [orderId : orderId]); + orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false); } if (orderHeader) { |
Free forum by Nabble | Edit this page |