Author: doogie
Date: Sat May 12 21:18:13 2012 New Revision: 1337663 URL: http://svn.apache.org/viewvc?rev=1337663&view=rev Log: DEPRECATION: applications/accounting: findByPrimaryKey variants replaced with findOne Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/ideal/IdealEvents.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/chartofaccounts/TaxAuthorityGlAccounts.groovy ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/ListNotAppliedPayments.groovy ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ListNotAppliedInvoices.groovy ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ListNotAppliedPayments.groovy ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ManualTx.groovy ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/PrintChecks.groovy ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/period/EditCustomTimePeriod.groovy ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/AuthorizeTransaction.groovy ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/CaptureTransaction.groovy ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy ofbiz/trunk/applications/accounting/webapp/accounting/payment/report/PaymentReport.rptdesign Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java Sat May 12 21:18:13 2012 @@ -102,7 +102,7 @@ public class FinAccountPaymentServices { GenericValue finAccount; if (finAccountId != null) { try { - finAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", finAccountId)); + finAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", finAccountId), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -133,7 +133,7 @@ public class FinAccountPaymentServices { try { // fin the store requires a pin number; validate the PIN with the code Map<String, Object> findProductStoreFinActSettingMap = UtilMisc.<String, Object>toMap("productStoreId", productStoreId, "finAccountTypeId", finAccountTypeId); - GenericValue finAccountSettings = delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", findProductStoreFinActSettingMap); + GenericValue finAccountSettings = delegator.findOne("ProductStoreFinActSetting", findProductStoreFinActSettingMap, true); if (finAccountSettings == null) { Debug.logWarning("In finAccountPreAuth could not find ProductStoreFinActSetting record, values searched by: " + findProductStoreFinActSettingMap, module); @@ -344,7 +344,7 @@ public class FinAccountPaymentServices { String finAccountAuthId = authTrans.getString("referenceNum"); GenericValue finAccountAuth; try { - finAccountAuth = delegator.findByPrimaryKey("FinAccountAuth", UtilMisc.toMap("finAccountAuthId", finAccountAuthId)); + finAccountAuth = delegator.findOne("FinAccountAuth", UtilMisc.toMap("finAccountAuthId", finAccountAuthId), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -553,7 +553,7 @@ public class FinAccountPaymentServices { GenericValue finAccount; try { - finAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", finAccountId)); + finAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", finAccountId), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -640,7 +640,7 @@ public class FinAccountPaymentServices { GenericValue finAccount; try { - finAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", finAccountId)); + finAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", finAccountId), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, @@ -718,7 +718,7 @@ public class FinAccountPaymentServices { // lookup the FinAccount GenericValue finAccount; try { - finAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", finAccountId)); + finAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", finAccountId), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -757,7 +757,7 @@ public class FinAccountPaymentServices { GenericValue finAccountSettings; Map<String, Object> psfasFindMap = UtilMisc.<String, Object>toMap("productStoreId", productStoreId, "finAccountTypeId", finAccount.getString("finAccountTypeId")); try { - finAccountSettings = delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", psfasFindMap); + finAccountSettings = delegator.findOne("ProductStoreFinActSetting", psfasFindMap, true); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -833,7 +833,7 @@ public class FinAccountPaymentServices { GenericValue paymentMethod; try { - paymentMethod = delegator.findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId)); + paymentMethod = delegator.findOne("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java Sat May 12 21:18:13 2012 @@ -96,7 +96,7 @@ public class FinAccountProductServices { // locate the financial account type GenericValue finAccountType; try { - finAccountType = delegator.findByPrimaryKey("FinAccountType", UtilMisc.toMap("finAccountTypeId", finAccountTypeId)); + finAccountType = delegator.findOne("FinAccountType", UtilMisc.toMap("finAccountTypeId", finAccountTypeId), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java Sat May 12 21:18:13 2012 @@ -98,7 +98,7 @@ public class FinAccountServices { // check for an existing account GenericValue creditAccount; if (finAccountId != null) { - creditAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", finAccountId)); + creditAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", finAccountId), false); } else { List<GenericValue> creditAccounts = delegator.findByAnd("FinAccount", lookupMap, UtilMisc.toList("-fromDate")); creditAccount = EntityUtil.getFirst(EntityUtil.filterByDate(creditAccounts)); @@ -126,7 +126,7 @@ public class FinAccountServices { if (createAccountResult != null) { String creditAccountId = (String) createAccountResult.get("finAccountId"); if (UtilValidate.isNotEmpty(creditAccountId)) { - creditAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", creditAccountId)); + creditAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", creditAccountId), false); // create the owner role Map<String, Object> roleCtx = FastMap.newInstance(); @@ -189,7 +189,7 @@ public class FinAccountServices { try { // get the product store id and use it to generate a unique fin account code - GenericValue productStoreFinAccountSetting = delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", finAccountTypeId)); + GenericValue productStoreFinAccountSetting = delegator.findOne("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", finAccountTypeId), true); if (productStoreFinAccountSetting == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, "AccountingFinAccountSetting", @@ -260,7 +260,7 @@ public class FinAccountServices { } } else { try { - finAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", finAccountId)); + finAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", finAccountId), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -303,7 +303,7 @@ public class FinAccountServices { GenericValue finAccount; try { - finAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", finAccountId)); + finAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", finAccountId), false); } catch (GenericEntityException ex) { return ServiceUtil.returnError(ex.getMessage()); } @@ -346,7 +346,7 @@ public class FinAccountServices { GenericValue finAccount; try { - finAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", finAccountId)); + finAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", finAccountId), false); } catch (GenericEntityException e) { return ServiceUtil.returnError(e.getMessage()); } @@ -388,9 +388,9 @@ public class FinAccountServices { // make sure there is an order available to refund if (orderId != null && orderItemSeqId != null) { - GenericValue orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId",orderId)); + GenericValue orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId",orderId), false); GenericValue productStore = delegator.getRelatedOne("ProductStore", orderHeader); - GenericValue orderItem = delegator.findByPrimaryKey("OrderItem", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId)); + GenericValue orderItem = delegator.findOne("OrderItem", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId), false); if (!"ITEM_CANCELLED".equals(orderItem.getString("statusId"))) { // make sure the item hasn't already been returned @@ -447,8 +447,8 @@ public class FinAccountServices { } // get the return item - GenericValue returnItem = delegator.findByPrimaryKey("ReturnItem", - UtilMisc.toMap("returnId", returnId, "returnItemSeqId", returnItemSeqId)); + GenericValue returnItem = delegator.findOne("ReturnItem", + UtilMisc.toMap("returnId", returnId, "returnItemSeqId", returnItemSeqId), false); GenericValue response = returnItem.getRelatedOne("ReturnItemResponse"); if (response == null) { throw new GeneralException("No return response found for: " + returnItem.getPrimaryKey()); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Sat May 12 21:18:13 2012 @@ -120,7 +120,7 @@ public class InvoiceServices { context.put("billItems", orderItems); } // get the system userid and store in context otherwise the invoice add service does not work - GenericValue userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system")); + GenericValue userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", "system"), false); if (userLogin != null) { context.put("userLogin", userLogin); } @@ -165,7 +165,7 @@ public class InvoiceServices { } try { - GenericValue orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); + GenericValue orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false); if (orderHeader == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingNoOrderHeader", locale)); @@ -496,7 +496,7 @@ public class InvoiceServices { invoiceItemSeqId = UtilFormatOut.formatPaddedNumber(invoiceItemSeqNum, INVOICE_ITEM_SEQUENCE_ID_DIGITS); // Get the original order item from the DB, in case the quantity has been overridden - GenericValue originalOrderItem = delegator.findByPrimaryKey("OrderItem", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItem.getString("orderItemSeqId"))); + GenericValue originalOrderItem = delegator.findOne("OrderItem", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItem.getString("orderItemSeqId")), false); // create the item adjustment as line items List<GenericValue> itemAdjustments = OrderReadHelper.getOrderItemAdjustmentList(orderItem, orh.getAdjustments()); @@ -1086,7 +1086,7 @@ public class InvoiceServices { if (orderShipment != null) { String orderId = orderShipment.getString("orderId"); try { - GenericValue orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); + GenericValue orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false); invoicePerShipment = orderHeader.getString("invoicePerShipment"); } catch (GenericEntityException e) { return ServiceUtil.returnError(e.getMessage()); @@ -1124,7 +1124,7 @@ public class InvoiceServices { // 2.b If the invoice is in status other then IN-Process, skip this. These would be already paid and captured. try { - delegator.findByPrimaryKey("Shipment", UtilMisc.toMap("shipmentId", shipmentId)); + delegator.findOne("Shipment", UtilMisc.toMap("shipmentId", shipmentId), false); } catch (GenericEntityException e) { Debug.logError(e, "Trouble getting Shipment entity for shipment " + shipmentId, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, @@ -1239,7 +1239,7 @@ public class InvoiceServices { //DEJ20060520: not used? planned to be used? List shipmentIdList = new LinkedList(); for (String tmpShipmentId : shipmentIds) { try { - GenericValue shipment = delegator.findByPrimaryKey("Shipment", UtilMisc.toMap("shipmentId", tmpShipmentId)); + GenericValue shipment = delegator.findOne("Shipment", UtilMisc.toMap("shipmentId", tmpShipmentId), false); if ((shipment.getString("shipmentTypeId") != null) && (shipment.getString("shipmentTypeId").equals("PURCHASE_SHIPMENT"))) { purchaseShipmentFound = true; } else if ((shipment.getString("shipmentTypeId") != null) && (shipment.getString("shipmentTypeId").equals("DROP_SHIPMENT"))) { @@ -1275,7 +1275,7 @@ public class InvoiceServices { while (itemsIter.hasNext()) { GenericValue item = itemsIter.next(); GenericValue inventoryItem = item.getRelatedOne("InventoryItem"); - GenericValue ownerPartyRole = delegator.findByPrimaryKeyCache("PartyRole", UtilMisc.toMap("partyId", inventoryItem.getString("ownerPartyId"), "roleTypeId", "INTERNAL_ORGANIZATIO")); + GenericValue ownerPartyRole = delegator.findOne("PartyRole", UtilMisc.toMap("partyId", inventoryItem.getString("ownerPartyId"), "roleTypeId", "INTERNAL_ORGANIZATIO"), true); if (UtilValidate.isEmpty(ownerPartyRole)) { itemsIter.remove(); } @@ -1726,10 +1726,10 @@ public class InvoiceServices { GenericValue itemMap = null; try { if (UtilValidate.isNotEmpty(key1)) { - itemMap = delegator.findByPrimaryKeyCache("InvoiceItemTypeMap", UtilMisc.toMap("invoiceItemMapKey", key1, "invoiceTypeId", invoiceTypeId)); + itemMap = delegator.findOne("InvoiceItemTypeMap", UtilMisc.toMap("invoiceItemMapKey", key1, "invoiceTypeId", invoiceTypeId), true); } if (itemMap == null && UtilValidate.isNotEmpty(key2)) { - itemMap = delegator.findByPrimaryKeyCache("InvoiceItemTypeMap", UtilMisc.toMap("invoiceItemMapKey", key2, "invoiceTypeId", invoiceTypeId)); + itemMap = delegator.findOne("InvoiceItemTypeMap", UtilMisc.toMap("invoiceItemMapKey", key2, "invoiceTypeId", invoiceTypeId), true); } } catch (GenericEntityException e) { Debug.logError(e, "Trouble getting InvoiceItemTypeMap entity record", module); @@ -1757,7 +1757,7 @@ public class InvoiceServices { try { // get the shipment and validate that it is a sales return - GenericValue shipment = delegator.findByPrimaryKey("Shipment", UtilMisc.toMap("shipmentId", shipmentId)); + GenericValue shipment = delegator.findOne("Shipment", UtilMisc.toMap("shipmentId", shipmentId), false); if (shipment == null) { return ServiceUtil.returnError(errorMsg + UtilProperties.getMessage(resource, "AccountingShipmentNotFound", locale)); @@ -1862,7 +1862,7 @@ public class InvoiceServices { String invoiceTypeId; String description; // get the return header - GenericValue returnHeader = delegator.findByPrimaryKey("ReturnHeader", UtilMisc.toMap("returnId", returnId)); + GenericValue returnHeader = delegator.findOne("ReturnHeader", UtilMisc.toMap("returnId", returnId), false); if (returnHeader == null || returnHeader.get("returnHeaderTypeId") == null) { return ServiceUtil.returnError("Return type cannot be null"); } @@ -2132,7 +2132,7 @@ public class InvoiceServices { String invoiceId = (String) context.get("invoiceId"); GenericValue invoice = null ; try { - invoice = delegator.findByPrimaryKey("Invoice", UtilMisc.toMap("invoiceId", invoiceId)); + invoice = delegator.findOne("Invoice", UtilMisc.toMap("invoiceId", invoiceId), false); } catch (GenericEntityException e) { Debug.logError(e, "Problem getting Invoice for Invoice ID" + invoiceId, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, @@ -2495,7 +2495,7 @@ public class InvoiceServices { errorMessageList.add(UtilProperties.getMessage(resource, "AccountingPaymentIdBlankNotSupplied", locale)); } else { try { - payment = delegator.findByPrimaryKey("Payment", UtilMisc.toMap("paymentId", paymentId)); + payment = delegator.findOne("Payment", UtilMisc.toMap("paymentId", paymentId), false); } catch (GenericEntityException e) { return ServiceUtil.returnError(e.getMessage()); } @@ -2529,7 +2529,7 @@ public class InvoiceServices { GenericValue toPayment = null; if (toPaymentId != null && !toPaymentId.equals("")) { try { - toPayment = delegator.findByPrimaryKey("Payment", UtilMisc.toMap("paymentId", toPaymentId)); + toPayment = delegator.findOne("Payment", UtilMisc.toMap("paymentId", toPaymentId), false); } catch (GenericEntityException e) { return ServiceUtil.returnError(e.getMessage()); } @@ -2585,7 +2585,7 @@ public class InvoiceServices { if (invoiceId != null) { GenericValue invoice = null; try { - invoice = delegator.findByPrimaryKey("Invoice", UtilMisc.toMap("invoiceId", invoiceId)); + invoice = delegator.findOne("Invoice", UtilMisc.toMap("invoiceId", invoiceId), false); } catch (GenericEntityException e) { return ServiceUtil.returnError(e.getMessage()); } @@ -2604,8 +2604,8 @@ public class InvoiceServices { GenericValue billingAccount = null; if (billingAccountId != null && !billingAccountId.equals("")) { try { - billingAccount = delegator.findByPrimaryKey("BillingAccount", - UtilMisc.toMap("billingAccountId", billingAccountId)); + billingAccount = delegator.findOne("BillingAccount", + UtilMisc.toMap("billingAccountId", billingAccountId), false); } catch (GenericEntityException e) { return ServiceUtil.returnError(e.getMessage()); } @@ -2634,7 +2634,7 @@ public class InvoiceServices { GenericValue invoiceItem = null; if (invoiceId != null) { try { - invoice = delegator.findByPrimaryKey("Invoice", UtilMisc.toMap("invoiceId", invoiceId)); + invoice = delegator.findOne("Invoice", UtilMisc.toMap("invoiceId", invoiceId), false); } catch (GenericEntityException e) { return ServiceUtil.returnError(e.getMessage()); } @@ -2713,8 +2713,8 @@ public class InvoiceServices { if (invoiceItemSeqId != null) { // when itemSeqNr not provided delay checking on invoiceItemSeqId try { - invoiceItem = delegator.findByPrimaryKey("InvoiceItem", - UtilMisc.toMap("invoiceId", invoiceId, "invoiceItemSeqId", invoiceItemSeqId)); + invoiceItem = delegator.findOne("InvoiceItem", + UtilMisc.toMap("invoiceId", invoiceId, "invoiceItemSeqId", invoiceItemSeqId), false); } catch (GenericEntityException e) { return ServiceUtil.returnError(e.getMessage()); } @@ -2788,8 +2788,8 @@ public class InvoiceServices { // prepare for creation } else { // retrieve existing paymentApplication try { - paymentApplication = delegator.findByPrimaryKey("PaymentApplication", - UtilMisc.toMap("paymentApplicationId", paymentApplicationId)); + paymentApplication = delegator.findOne("PaymentApplication", + UtilMisc.toMap("paymentApplicationId", paymentApplicationId), false); } catch (GenericEntityException e) { return ServiceUtil.returnError(e.getMessage()); } @@ -3312,7 +3312,7 @@ public class InvoiceServices { String paymentId = (String) context.get("paymentId"); try { - GenericValue payment = delegator.findByPrimaryKey("Payment", UtilMisc.toMap("paymentId", paymentId)); + GenericValue payment = delegator.findOne("Payment", UtilMisc.toMap("paymentId", paymentId), false); if (payment == null) throw new GenericServiceException("Payment with ID [" + paymentId + "] not found!"); List<GenericValue> paymentApplications = payment.getRelated("PaymentApplication"); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java Sat May 12 21:18:13 2012 @@ -82,7 +82,7 @@ public class InvoiceWorker { GenericValue invoice = null; try { - invoice = delegator.findByPrimaryKey("Invoice", UtilMisc.toMap("invoiceId", invoiceId)); + invoice = delegator.findOne("Invoice", UtilMisc.toMap("invoiceId", invoiceId), false); } catch (GenericEntityException e) { Debug.logError(e, "Problem getting Invoice", module); } @@ -455,7 +455,7 @@ public class InvoiceWorker { GenericValue invoiceItem = null; try { - invoiceItem = delegator.findByPrimaryKey("Invoice", UtilMisc.toMap("invoiceId", invoiceId,"invoiceItemSeqId", invoiceItemSeqId)); + invoiceItem = delegator.findOne("Invoice", UtilMisc.toMap("invoiceId", invoiceId,"invoiceItemSeqId", invoiceItemSeqId), false); } catch (GenericEntityException e) { Debug.logError(e, "Problem getting InvoiceItem", module); } @@ -493,9 +493,9 @@ public class InvoiceWorker { String otherCurrencyUomId = null; // find the organization party currencyUomId which different from the invoice currency try { - GenericValue party = delegator.findByPrimaryKey("PartyAcctgPreference", UtilMisc.toMap("partyId", invoice.getString("partyIdFrom"))); + GenericValue party = delegator.findOne("PartyAcctgPreference", UtilMisc.toMap("partyId", invoice.getString("partyIdFrom")), false); if (UtilValidate.isEmpty(party) || party.getString("baseCurrencyUomId").equals(invoice.getString("currencyUomId"))) { - party = delegator.findByPrimaryKey("PartyAcctgPreference", UtilMisc.toMap("partyId", invoice.getString("partyId"))); + party = delegator.findOne("PartyAcctgPreference", UtilMisc.toMap("partyId", invoice.getString("partyId")), false); } if (UtilValidate.isNotEmpty(party) && party.getString("baseCurrencyUomId") != null) { otherCurrencyUomId = party.getString("baseCurrencyUomId"); @@ -557,7 +557,7 @@ public class InvoiceWorker { GenericValue invoice = null; try { - invoice = delegator.findByPrimaryKey("Invoice", UtilMisc.toMap("invoiceId", invoiceId)); + invoice = delegator.findOne("Invoice", UtilMisc.toMap("invoiceId", invoiceId), false); } catch (GenericEntityException e) { Debug.logError(e, "Problem getting Invoice", module); } Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java Sat May 12 21:18:13 2012 @@ -132,7 +132,7 @@ public class BillingAccountWorker { * @throws GenericEntityException */ public static BigDecimal getBillingAccountBalance(Delegator delegator, String billingAccountId) throws GenericEntityException { - GenericValue billingAccount = delegator.findByPrimaryKey("BillingAccount", UtilMisc.toMap("billingAccountId", billingAccountId)); + GenericValue billingAccount = delegator.findOne("BillingAccount", UtilMisc.toMap("billingAccountId", billingAccountId), false); return getBillingAccountBalance(billingAccount); } @@ -235,7 +235,7 @@ public class BillingAccountWorker { } public static BigDecimal getBillingAccountAvailableBalance(Delegator delegator, String billingAccountId) throws GenericEntityException { - GenericValue billingAccount = delegator.findByPrimaryKey("BillingAccount", UtilMisc.toMap("billingAccountId", billingAccountId)); + GenericValue billingAccount = delegator.findOne("BillingAccount", UtilMisc.toMap("billingAccountId", billingAccountId), false); return getBillingAccountAvailableBalance(billingAccount); } @@ -290,7 +290,7 @@ public class BillingAccountWorker { Map<String, Object> result = ServiceUtil.returnSuccess(); try { - GenericValue billingAccount = delegator.findByPrimaryKey("BillingAccount", UtilMisc.toMap("billingAccountId", billingAccountId)); + GenericValue billingAccount = delegator.findOne("BillingAccount", UtilMisc.toMap("billingAccountId", billingAccountId), false); if (billingAccount == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, "AccountingBillingAccountNotFound", Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java Sat May 12 21:18:13 2012 @@ -86,7 +86,7 @@ public class GiftCertificateServices { final String accountName = "Gift Certificate Account"; final String deposit = "DEPOSIT"; - GenericValue giftCertSettings = delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId)); + GenericValue giftCertSettings = delegator.findOne("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId), true); Map<String, Object> acctResult = null; if ("Y".equals(giftCertSettings.getString("requirePinCode"))) { @@ -130,7 +130,7 @@ public class GiftCertificateServices { // create the initial (deposit) transaction // do something tricky here: run as the "system" user // that can actually create a financial account transaction - GenericValue permUserLogin = delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId", "system")); + GenericValue permUserLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", "system"), true); refNum = createTransaction(delegator, dispatcher, permUserLogin, initialAmount, productStoreId, partyId, currencyUom, deposit, finAccountId, locale); @@ -183,7 +183,7 @@ public class GiftCertificateServices { GenericValue finAccount = null; // validate the pin if the store requires it and figure out the finAccountId from card number try { - GenericValue giftCertSettings = delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId)); + GenericValue giftCertSettings = delegator.findOne("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId), true); if ("Y".equals(giftCertSettings.getString("requirePinCode"))) { if (!validatePin(delegator, cardNumber, pinNumber)) { return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, @@ -210,7 +210,7 @@ public class GiftCertificateServices { if (finAccount == null) { try { - finAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", finAccountId)); + finAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", finAccountId), false); } catch (GenericEntityException e) { return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, "AccountingFinAccountNotFound", UtilMisc.toMap("finAccountId", finAccountId), locale)); @@ -275,7 +275,7 @@ public class GiftCertificateServices { // validate the pin if the store requires it try { - GenericValue giftCertSettings = delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId)); + GenericValue giftCertSettings = delegator.findOne("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId), true); if ("Y".equals(giftCertSettings.getString("requirePinCode")) && !validatePin(delegator, cardNumber, pinNumber)) { return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, "AccountingGiftCerticateNumberPinNotValid", locale)); @@ -290,7 +290,7 @@ public class GiftCertificateServices { GenericValue finAccount = null; try { - finAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", cardNumber)); + finAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", cardNumber), false); } catch (GenericEntityException e) { return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, "AccountingFinAccountNotFound", UtilMisc.toMap("finAccountId", cardNumber), locale)); @@ -344,7 +344,7 @@ public class GiftCertificateServices { GenericValue finAccount = null; try { - finAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", cardNumber)); + finAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", cardNumber), false); } catch (GenericEntityException e) { return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, "AccountingFinAccountNotFound", UtilMisc.toMap("finAccountId", cardNumber), locale)); @@ -388,7 +388,7 @@ public class GiftCertificateServices { // get the gift certificate and its authorization from the authorization String finAccountAuthId = authTransaction.getString("referenceNum"); try { - GenericValue finAccountAuth = delegator.findByPrimaryKey("FinAccountAuth", UtilMisc.toMap("finAccountAuthId", finAccountAuthId)); + GenericValue finAccountAuth = delegator.findOne("FinAccountAuth", UtilMisc.toMap("finAccountAuthId", finAccountAuthId), false); GenericValue giftCard = finAccountAuth.getRelatedOne("FinAccount"); // make sure authorization has not expired Timestamp authExpiration = finAccountAuth.getTimestamp("thruDate"); @@ -479,14 +479,14 @@ public class GiftCertificateServices { try { // if the store requires pin codes, then validate pin code against card number, and the gift certificate's finAccountId is the gift card's card number // otherwise, the gift card's card number is an ecrypted string, which must be decoded to find the FinAccount - GenericValue giftCertSettings = delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId)); + GenericValue giftCertSettings = delegator.findOne("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId), true); GenericValue finAccount = null; String finAccountId = null; if (UtilValidate.isNotEmpty(giftCertSettings)) { if ("Y".equals(giftCertSettings.getString("requirePinCode"))) { if (validatePin(delegator, giftCard.getString("cardNumber"), giftCard.getString("pinNumber"))) { finAccountId = giftCard.getString("cardNumber"); - finAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", finAccountId)); + finAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", finAccountId), false); } } else { finAccount = FinAccountHelper.getFinAccountFromCode(giftCard.getString("cardNumber"), delegator); @@ -755,7 +755,7 @@ public class GiftCertificateServices { // Gift certificate settings are per store in this entity GenericValue giftCertSettings = null; try { - giftCertSettings = delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId)); + giftCertSettings = delegator.findOne("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", FinAccountHelper.giftCertFinAccountTypeId), true); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get Product Store FinAccount settings for " + FinAccountHelper.giftCertFinAccountTypeId, module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, @@ -884,8 +884,8 @@ public class GiftCertificateServices { GenericValue productStoreEmail = null; String emailType = "PRDS_GC_PURCHASE"; try { - productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", - UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType)); + productStoreEmail = delegator.findOne("ProductStoreEmailSetting", + UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType), false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get product store email setting for gift card purchase", module); } @@ -1130,7 +1130,7 @@ public class GiftCertificateServices { GenericValue productStoreEmail = null; String emailType = "PRDS_GC_RELOAD"; try { - productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType)); + productStoreEmail = delegator.findOne("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType), false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get product store email setting for gift card purchase", module); } @@ -1309,7 +1309,7 @@ public class GiftCertificateServices { // need the admin userLogin to "fake" out the update service GenericValue admin = null; try { - admin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "admin")); + admin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", "admin"), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrderError, @@ -1346,7 +1346,7 @@ public class GiftCertificateServices { private static boolean validatePin(Delegator delegator, String cardNumber, String pinNumber) { GenericValue finAccount = null; try { - finAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", cardNumber)); + finAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", cardNumber), false); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -1476,7 +1476,7 @@ public class GiftCertificateServices { } private static boolean checkNumberInDatabase(Delegator delegator, String number) throws GenericEntityException { - GenericValue finAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", number)); + GenericValue finAccount = delegator.findOne("FinAccount", UtilMisc.toMap("finAccountId", number), false); if (finAccount == null) { return true; } @@ -1492,7 +1492,7 @@ public class GiftCertificateServices { String payToPartyId = "Company"; // default value GenericValue productStore = null; try { - productStore = delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId", productStoreId)); + productStore = delegator.findOne("ProductStore", UtilMisc.toMap("productStoreId", productStoreId), false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to locate ProductStore (" + productStoreId + ")", module); return null; Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java Sat May 12 21:18:13 2012 @@ -128,8 +128,8 @@ public class PaymentGatewayServices { GenericValue orderHeader = null; GenericValue orderPaymentPreference = null; try { - orderPaymentPreference = delegator.findByPrimaryKey("OrderPaymentPreference", - UtilMisc.toMap("orderPaymentPreferenceId", orderPaymentPreferenceId)); + orderPaymentPreference = delegator.findOne("OrderPaymentPreference", + UtilMisc.toMap("orderPaymentPreferenceId", orderPaymentPreferenceId), false); orderHeader = orderPaymentPreference.getRelatedOne("OrderHeader"); } catch (GenericEntityException e) { Debug.logError(e, module); @@ -333,7 +333,7 @@ public class PaymentGatewayServices { try { // get the OrderHeader - orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); + orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false); // get the payments to auth Map<String, String> lookupMap = UtilMisc.toMap("orderId", orderId, "statusId", "PAYMENT_NOT_AUTH"); @@ -485,7 +485,7 @@ public class PaymentGatewayServices { GenericValue visit = null; if (visitId != null) { try { - visit = orderHeader.getDelegator().findByPrimaryKey("Visit", UtilMisc.toMap("visitId", visitId)); + visit = orderHeader.getDelegator().findOne("Visit", UtilMisc.toMap("visitId", visitId), false); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -885,7 +885,7 @@ public class PaymentGatewayServices { // Get the OrderPaymentPreference GenericValue paymentPref = null; try { - paymentPref = delegator.findByPrimaryKey("OrderPaymentPreference", UtilMisc.toMap("orderPaymentPreferenceId", orderPaymentPreferenceId)); + paymentPref = delegator.findOne("OrderPaymentPreference", UtilMisc.toMap("orderPaymentPreferenceId", orderPaymentPreferenceId), false); } catch (GenericEntityException e) { Debug.logWarning(e, "Problem getting OrderPaymentPreference for orderPaymentPreferenceId " + orderPaymentPreferenceId, module); @@ -905,7 +905,7 @@ public class PaymentGatewayServices { GenericValue orderHeader = null; String orderId = paymentPref.getString("orderId"); try { - orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); + orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false); } catch (GenericEntityException e) { Debug.logWarning(e, "Problem getting OrderHeader for orderId " + orderId, module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrder, @@ -1089,7 +1089,7 @@ public class PaymentGatewayServices { // lookup the invoice GenericValue invoice = null; try { - invoice = delegator.findByPrimaryKey("Invoice", UtilMisc.toMap("invoiceId", invoiceId)); + invoice = delegator.findOne("Invoice", UtilMisc.toMap("invoiceId", invoiceId), false); } catch (GenericEntityException e) { Debug.logError(e, "Trouble looking up Invoice #" + invoiceId, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, @@ -1181,7 +1181,7 @@ public class PaymentGatewayServices { List<GenericValue> paymentPrefsBa = null; try { - orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); + orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false); // get the payment prefs Map<String, String> lookupMap = UtilMisc.toMap("orderId", orderId, "statusId", "PAYMENT_AUTHORIZED"); @@ -1507,7 +1507,7 @@ public class PaymentGatewayServices { try { // Note that the partyIdFrom of the Payment should be the partyIdTo of the invoice, since you're receiving a payment from the party you billed - GenericValue invoice = delegator.findByPrimaryKey("Invoice", UtilMisc.toMap("invoiceId", invoiceId)); + GenericValue invoice = delegator.findOne("Invoice", UtilMisc.toMap("invoiceId", invoiceId), false); Map<String, Object> paymentParams = UtilMisc.<String, Object>toMap("paymentTypeId", "CUSTOMER_PAYMENT", "paymentMethodTypeId", "EXT_BILLACT", "partyIdFrom", invoice.getString("partyId"), "partyIdTo", invoice.getString("partyIdFrom"), "statusId", "PMNT_RECEIVED", "effectiveDate", UtilDateTime.nowTimestamp()); @@ -1534,7 +1534,7 @@ public class PaymentGatewayServices { if (orderId != null && captureAmount.compareTo(BigDecimal.ZERO) > 0) { // Create a paymentGatewayResponse, if necessary - GenericValue order = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); + GenericValue order = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false); if (order == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingNoPaymentGatewayResponseCreatedForInvoice", @@ -1909,7 +1909,7 @@ public class PaymentGatewayServices { try { String paymentMethodId = orderPaymentPreference.getString("paymentMethodId"); - GenericValue paymentMethod = delegator.findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId)); + GenericValue paymentMethod = delegator.findOne("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); GenericValue creditCard = null; if (paymentMethod != null && "CREDIT_CARD".equals(paymentMethod.getString("paymentMethodTypeId"))) { creditCard = paymentMethod.getRelatedOne("CreditCard"); @@ -2282,7 +2282,7 @@ public class PaymentGatewayServices { GenericValue invoice = null; if (invoiceId != null) { try { - invoice = delegator.findByPrimaryKey("Invoice", UtilMisc.toMap("invoiceId", invoiceId)); + invoice = delegator.findOne("Invoice", UtilMisc.toMap("invoiceId", invoiceId), false); } catch (GenericEntityException e) { String message = "Failed to process capture result: Could not find invoice ["+invoiceId+"] due to entity error: " + e.getMessage(); Debug.logError(e, message, module); @@ -2639,7 +2639,7 @@ public class PaymentGatewayServices { // 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.toString()); @@ -3009,7 +3009,7 @@ public class PaymentGatewayServices { // check the payment method; verify type GenericValue paymentMethod; try { - paymentMethod = delegator.findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId)); + paymentMethod = delegator.findOne("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -3031,7 +3031,7 @@ public class PaymentGatewayServices { // get the credit card object GenericValue creditCard; try { - creditCard = delegator.findByPrimaryKey("CreditCard", UtilMisc.toMap("paymentMethodId", paymentMethodId)); + creditCard = delegator.findOne("CreditCard", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java Sat May 12 21:18:13 2012 @@ -73,7 +73,7 @@ public class PaymentMethodServices { GenericValue paymentMethod = null; try { - paymentMethod = delegator.findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId)); + paymentMethod = delegator.findOne("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); } catch (GenericEntityException e) { Debug.logWarning(e.toString(), module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, @@ -274,8 +274,8 @@ public class PaymentMethodServices { String paymentMethodId = (String) context.get("paymentMethodId"); try { - creditCard = delegator.findByPrimaryKey("CreditCard", UtilMisc.toMap("paymentMethodId", paymentMethodId)); - paymentMethod = delegator.findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId)); + creditCard = delegator.findOne("CreditCard", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); + paymentMethod = delegator.findOne("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, @@ -445,7 +445,7 @@ public class PaymentMethodServices { Delegator delegator = dctx.getDelegator(); GenericValue creditCard; try { - creditCard = delegator.findByPrimaryKey("CreditCard", UtilMisc.toMap("paymentMethodId", paymentMethodId)); + creditCard = delegator.findOne("CreditCard", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -560,8 +560,8 @@ public class PaymentMethodServices { String paymentMethodId = (String) context.get("paymentMethodId"); try { - giftCard = delegator.findByPrimaryKey("GiftCard", UtilMisc.toMap("paymentMethodId", paymentMethodId)); - paymentMethod = delegator.findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId)); + giftCard = delegator.findOne("GiftCard", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); + paymentMethod = delegator.findOne("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, @@ -791,9 +791,9 @@ public class PaymentMethodServices { String paymentMethodId = (String) context.get("paymentMethodId"); try { - eftAccount = delegator.findByPrimaryKey("EftAccount", UtilMisc.toMap("paymentMethodId", paymentMethodId)); + eftAccount = delegator.findOne("EftAccount", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); paymentMethod = - delegator.findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId)); + delegator.findOne("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java Sat May 12 21:18:13 2012 @@ -113,10 +113,10 @@ public class PaymentWorker { if (UtilValidate.isNotEmpty(paymentMethodId)) { try { - paymentMethod = delegator.findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId)); - creditCard = delegator.findByPrimaryKey("CreditCard", UtilMisc.toMap("paymentMethodId", paymentMethodId)); - giftCard = delegator.findByPrimaryKey("GiftCard", UtilMisc.toMap("paymentMethodId", paymentMethodId)); - eftAccount = delegator.findByPrimaryKey("EftAccount", UtilMisc.toMap("paymentMethodId", paymentMethodId)); + paymentMethod = delegator.findOne("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); + creditCard = delegator.findOne("CreditCard", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); + giftCard = delegator.findOne("GiftCard", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); + eftAccount = delegator.findOne("EftAccount", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); } catch (GenericEntityException e) { Debug.logWarning(e, module); } @@ -171,7 +171,7 @@ public class PaymentWorker { GenericValue postalAddress = null; if (purpose != null) { try { - postalAddress = delegator.findByPrimaryKey("PostalAddress", UtilMisc.toMap("contactMechId", purpose.getString("contactMechId"))); + postalAddress = delegator.findOne("PostalAddress", UtilMisc.toMap("contactMechId", purpose.getString("contactMechId")), false); } catch (GenericEntityException e) { Debug.logError(e, "Trouble getting PostalAddress record for contactMechId: " + purpose.getString("contactMechId"), module); } @@ -216,7 +216,7 @@ public class PaymentWorker { GenericValue payment = null; try { - payment = delegator.findByPrimaryKey("Payment", UtilMisc.toMap("paymentId", paymentId)); + payment = delegator.findOne("Payment", UtilMisc.toMap("paymentId", paymentId), false); } catch (GenericEntityException e) { Debug.logError(e, "Problem getting Payment", module); } @@ -236,7 +236,7 @@ public class PaymentWorker { GenericValue paymentApplication = null; BigDecimal appliedAmount = BigDecimal.ZERO; try { - paymentApplication = delegator.findByPrimaryKey("PaymentApplication", UtilMisc.toMap("paymentApplicationId", paymentApplicationId)); + paymentApplication = delegator.findOne("PaymentApplication", UtilMisc.toMap("paymentApplicationId", paymentApplicationId), false); appliedAmount = paymentApplication.getBigDecimal("amountApplied"); if (paymentApplication.get("paymentId") != null) { GenericValue payment = paymentApplication.getRelatedOne("Payment"); @@ -322,7 +322,7 @@ public class PaymentWorker { GenericValue payment = null; try { - payment = delegator.findByPrimaryKey("Payment", UtilMisc.toMap("paymentId", paymentId)); + payment = delegator.findOne("Payment", UtilMisc.toMap("paymentId", paymentId), false); } catch (GenericEntityException e) { Debug.logError(e, "Problem getting Payment", module); } Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java Sat May 12 21:18:13 2012 @@ -83,8 +83,8 @@ public class TaxAuthorityServices { if (shippingPrice != null) priceWithTax = priceWithTax.add(shippingPrice); try { - GenericValue product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId)); - GenericValue productStore = delegator.findByPrimaryKeyCache("ProductStore", UtilMisc.toMap("productStoreId", productStoreId)); + GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), true); + GenericValue productStore = delegator.findOne("ProductStore", UtilMisc.toMap("productStoreId", productStoreId), true); if (productStore == null) { throw new IllegalArgumentException("Could not find ProductStore with ID [" + productStoreId + "] for tax calculation"); } @@ -95,7 +95,7 @@ public class TaxAuthorityServices { List<GenericValue> taxAuthorityRawList = delegator.findList("TaxAuthority", EntityCondition.makeCondition("taxAuthGeoId", EntityOperator.EQUALS, productStore.get("vatTaxAuthGeoId")), null, null, null, true); taxAuthoritySet.addAll(taxAuthorityRawList); } else { - GenericValue taxAuthority = delegator.findByPrimaryKeyCache("TaxAuthority", UtilMisc.toMap("taxAuthGeoId", productStore.get("vatTaxAuthGeoId"), "taxAuthPartyId", productStore.get("vatTaxAuthPartyId"))); + GenericValue taxAuthority = delegator.findOne("TaxAuthority", UtilMisc.toMap("taxAuthGeoId", productStore.get("vatTaxAuthGeoId"), "taxAuthPartyId", productStore.get("vatTaxAuthPartyId")), true); taxAuthoritySet.add(taxAuthority); } @@ -155,10 +155,10 @@ public class TaxAuthorityServices { GenericValue facility = null; try { if (productStoreId != null) { - productStore = delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId", productStoreId)); + productStore = delegator.findOne("ProductStore", UtilMisc.toMap("productStoreId", productStoreId), false); } if (facilityId != null) { - facility = delegator.findByPrimaryKey("Facility", UtilMisc.toMap("facilityId", facilityId)); + facility = delegator.findOne("Facility", UtilMisc.toMap("facilityId", facilityId), false); } } catch (GenericEntityException e) { Debug.logError(e, "Data error getting tax settings: " + e.toString(), module); @@ -174,8 +174,8 @@ public class TaxAuthorityServices { try { GenericValue facilityContactMech = ContactMechWorker.getFacilityContactMechByPurpose(delegator, facilityId, UtilMisc.toList("SHIP_ORIG_LOCATION", "PRIMARY_LOCATION")); if (facilityContactMech != null) { - shippingAddress = delegator.findByPrimaryKey("PostalAddress", - UtilMisc.toMap("contactMechId", facilityContactMech.getString("contactMechId"))); + shippingAddress = delegator.findOne("PostalAddress", + UtilMisc.toMap("contactMechId", facilityContactMech.getString("contactMechId")), false); } } catch (GenericEntityException e) { Debug.logError(e, "Data error getting tax settings: " + e.toString(), module); @@ -416,7 +416,7 @@ public class TaxAuthorityServices { String taxAuthPartyId = taxAuthorityRateProduct.getString("taxAuthPartyId"); // get glAccountId from TaxAuthorityGlAccount entity using the payToPartyId as the organizationPartyId - GenericValue taxAuthorityGlAccount = delegator.findByPrimaryKey("TaxAuthorityGlAccount", UtilMisc.toMap("taxAuthPartyId", taxAuthPartyId, "taxAuthGeoId", taxAuthGeoId, "organizationPartyId", payToPartyId)); + GenericValue taxAuthorityGlAccount = delegator.findOne("TaxAuthorityGlAccount", UtilMisc.toMap("taxAuthPartyId", taxAuthPartyId, "taxAuthGeoId", taxAuthGeoId, "organizationPartyId", payToPartyId), false); String taxAuthGlAccountId = null; if (taxAuthorityGlAccount != null) { taxAuthGlAccountId = taxAuthorityGlAccount.getString("glAccountId"); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/test/FinAccountTests.java Sat May 12 21:18:13 2012 @@ -42,7 +42,7 @@ public class FinAccountTests extends OFB @Override protected void setUp() throws Exception { - userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system")); + userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", "system"), false); } @Override Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java Sat May 12 21:18:13 2012 @@ -401,8 +401,8 @@ public class IcsPaymentServices { if (party != null) { GenericValue avsOverride = null; try { - avsOverride = party.getDelegator().findByPrimaryKey("PartyIcsAvsOverride", - UtilMisc.toMap("partyId", party.getString("partyId"))); + avsOverride = party.getDelegator().findOne("PartyIcsAvsOverride", + UtilMisc.toMap("partyId", party.getString("partyId")), false); } catch (GenericEntityException e) { Debug.logError(e, module); } Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java Sat May 12 21:18:13 2012 @@ -405,7 +405,7 @@ public class RitaServices { GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); GenericValue creditCard = (GenericValue) context.get("creditCard"); if (creditCard == null) { - creditCard = delegator.findByPrimaryKey("CreditCard", UtilMisc.toMap("paymentMethodId", orderPaymentPreference.getString("paymentMethodId"))); + creditCard = delegator.findOne("CreditCard", UtilMisc.toMap("paymentMethodId", orderPaymentPreference.getString("paymentMethodId")), false); } if (creditCard != null) { List<String> expDateList = StringUtil.split(creditCard.getString("expireDate"), "/"); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/ideal/IdealEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/ideal/IdealEvents.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/ideal/IdealEvents.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/ideal/IdealEvents.java Sat May 12 21:18:13 2012 @@ -83,7 +83,7 @@ public class IdealEvents { GenericValue orderHeader = null; List<GenericValue> orderItemList = null; try { - orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); + orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false); orderItemList = delegator.findByAnd("OrderItem", UtilMisc.toMap("orderId", orderId)); } catch (GenericEntityException e) { Debug.logError(e, "Cannot get the order header for order: " + orderId, module); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalEvents.java Sat May 12 21:18:13 2012 @@ -76,7 +76,7 @@ public class PayPalEvents { // 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, "Cannot get the order header for order: " + orderId, module); request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resourceErr, "payPalEvents.problemsGettingOrderHeader", locale)); @@ -262,7 +262,7 @@ public class PayPalEvents { // get the system user GenericValue userLogin = null; try { - userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system")); + userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", "system"), false); } catch (GenericEntityException e) { Debug.logError(e, "Cannot get UserLogin for: system; cannot continue", module); request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resourceErr, "payPalEvents.problemsGettingAuthenticationUser", locale)); @@ -276,7 +276,7 @@ public class PayPalEvents { GenericValue orderHeader = null; if (UtilValidate.isNotEmpty(orderId)) { try { - orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); + orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false); } catch (GenericEntityException e) { Debug.logError(e, "Cannot get the order header for order: " + orderId, module); request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resourceErr, "payPalEvents.problemsGettingOrderHeader", locale)); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkApi.java Sat May 12 21:18:13 2012 @@ -740,7 +740,7 @@ public class ValueLinkApi { public GenericValue getGenericValue() { GenericValue value = null; try { - value = delegator.findByPrimaryKeyCache("ValueLinkKey", UtilMisc.toMap("merchantId", merchantId)); + value = delegator.findOne("ValueLinkKey", UtilMisc.toMap("merchantId", merchantId), true); } catch (GenericEntityException e) { Debug.logError(e, module); } Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java Sat May 12 21:18:13 2012 @@ -1265,7 +1265,7 @@ public class ValueLinkServices { GenericValue productStoreEmail = null; String emailType = "PRDS_GC_PURCHASE"; try { - productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType)); + productStoreEmail = delegator.findOne("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType), false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get product store email setting for gift card purchase", module); } @@ -1517,7 +1517,7 @@ public class ValueLinkServices { GenericValue productStoreEmail = null; String emailType = "PRDS_GC_RELOAD"; try { - productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType)); + productStoreEmail = delegator.findOne("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", emailType), false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get product store email setting for gift card purchase", module); } Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java Sat May 12 21:18:13 2012 @@ -56,8 +56,8 @@ public class UtilAccounting { GenericValue account = null; try { // first try to find the account in ProductGlAccount - account = delegator.findByPrimaryKeyCache("ProductGlAccount", - UtilMisc.toMap("productId", productId, "glAccountTypeId", glAccountTypeId, "organizationPartyId", organizationPartyId)); + account = delegator.findOne("ProductGlAccount", + UtilMisc.toMap("productId", productId, "glAccountTypeId", glAccountTypeId, "organizationPartyId", organizationPartyId), true); } catch (GenericEntityException e) { throw new AccountingException("Failed to find a ProductGLAccount for productId [" + productId + "], organization [" + organizationPartyId + "], and productGlAccountTypeId [" + glAccountTypeId + "].", e); } @@ -65,7 +65,7 @@ public class UtilAccounting { // otherwise try the default accounts if (account == null) { try { - account = delegator.findByPrimaryKeyCache("GlAccountTypeDefault", UtilMisc.toMap("glAccountTypeId", glAccountTypeId, "organizationPartyId", organizationPartyId)); + account = delegator.findOne("GlAccountTypeDefault", UtilMisc.toMap("glAccountTypeId", glAccountTypeId, "organizationPartyId", organizationPartyId), true); } catch (GenericEntityException e) { throw new AccountingException("Failed to find a GlAccountTypeDefault for glAccountTypeId [" + glAccountTypeId + "] and organizationPartyId [" + organizationPartyId+ "].", e); } Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/chartofaccounts/TaxAuthorityGlAccounts.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/chartofaccounts/TaxAuthorityGlAccounts.groovy?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/chartofaccounts/TaxAuthorityGlAccounts.groovy (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/chartofaccounts/TaxAuthorityGlAccounts.groovy Sat May 12 21:18:13 2012 @@ -23,7 +23,7 @@ import javolution.util.FastList; taxAuthorityHavingNoGlAccountList = FastList.newInstance(); taxAuthorities = delegator.findList("TaxAuthority", null, null, ["taxAuthGeoId", "taxAuthPartyId"], null, false); taxAuthorities.each { taxAuthority -> - taxAuthorityGlAccount = delegator.findByPrimaryKey("TaxAuthorityGlAccount", [taxAuthGeoId : taxAuthority.taxAuthGeoId, taxAuthPartyId : taxAuthority.taxAuthPartyId, organizationPartyId : organizationPartyId]); + taxAuthorityGlAccount = delegator.findOne("TaxAuthorityGlAccount", [taxAuthGeoId : taxAuthority.taxAuthGeoId, taxAuthPartyId : taxAuthority.taxAuthPartyId, organizationPartyId : organizationPartyId], false); if (!taxAuthorityGlAccount) { taxAuthorityHavingNoGlAccountList.add(taxAuthority); } Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy Sat May 12 21:18:13 2012 @@ -35,7 +35,7 @@ import javolution.util.FastMap; invoiceId = parameters.get("invoiceId"); -invoice = delegator.findByPrimaryKey("Invoice", [invoiceId : invoiceId]); +invoice = delegator.findOne("Invoice", [invoiceId : invoiceId], false); context.invoice = invoice; currency = parameters.currency; // allow the display of the invoice in the original currency, the default is to display the invoice in the default currency Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/ListNotAppliedPayments.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/ListNotAppliedPayments.groovy?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/ListNotAppliedPayments.groovy (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/ListNotAppliedPayments.groovy Sat May 12 21:18:13 2012 @@ -32,7 +32,7 @@ import org.ofbiz.entity.condition.Entity import java.math.*; invoiceId = parameters.invoiceId; -invoice = delegator.findByPrimaryKey("Invoice", [invoiceId : invoiceId]); +invoice = delegator.findOne("Invoice", [invoiceId : invoiceId], false); decimals = UtilNumber.getBigDecimalScale("invoice.decimals"); rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding"); Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ListNotAppliedInvoices.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ListNotAppliedInvoices.groovy?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ListNotAppliedInvoices.groovy (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ListNotAppliedInvoices.groovy Sat May 12 21:18:13 2012 @@ -31,7 +31,7 @@ import org.ofbiz.entity.condition.Entity import java.math.*; paymentId = parameters.paymentId; -payment = delegator.findByPrimaryKey("Payment", [paymentId : paymentId]); +payment = delegator.findOne("Payment", [paymentId : paymentId], false); decimals = UtilNumber.getBigDecimalScale("invoice.decimals"); rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding"); Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ListNotAppliedPayments.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ListNotAppliedPayments.groovy?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ListNotAppliedPayments.groovy (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ListNotAppliedPayments.groovy Sat May 12 21:18:13 2012 @@ -34,7 +34,7 @@ import org.ofbiz.entity.model.*; import java.text.NumberFormat; basePaymentId = parameters.paymentId; -basePayment = delegator.findByPrimaryKey("Payment", [paymentId : basePaymentId]); +basePayment = delegator.findOne("Payment", [paymentId : basePaymentId], false); decimals = UtilNumber.getBigDecimalScale("invoice.decimals"); rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding"); Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ManualTx.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ManualTx.groovy?rev=1337663&r1=1337662&r2=1337663&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ManualTx.groovy (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ManualTx.groovy Sat May 12 21:18:13 2012 @@ -26,7 +26,7 @@ context.productStores = productStores; // current store productStoreId = parameters.productStoreId; if (productStoreId) { - productStore = delegator.findByPrimaryKey("ProductStore", [productStoreId : productStoreId]); + productStore = delegator.findOne("ProductStore", [productStoreId : productStoreId], false); context.currentStore = productStore; } @@ -46,12 +46,12 @@ context.paymentMethodTypeId = paymentMet txType = parameters.transactionType; context.txType = txType; if (txType) { - currentTx = delegator.findByPrimaryKey("Enumeration", [enumId : txType]); + currentTx = delegator.findOne("Enumeration", [enumId : txType], false); context.currentTx = currentTx; } if (paymentMethodId) { - paymentMethod = delegator.findByPrimaryKey("PaymentMethod", [paymentMethodId : paymentMethodId]); + paymentMethod = delegator.findOne("PaymentMethod", [paymentMethodId : paymentMethodId], false); if (paymentMethod) { // payment method type paymentMethodTypeId = paymentMethod.paymentMethodTypeId; @@ -82,7 +82,7 @@ if (paymentMethodId) { } if (paymentMethodTypeId) { - paymentMethodType = delegator.findByPrimaryKey("PaymentMethodType", [paymentMethodTypeId : paymentMethodTypeId]); + paymentMethodType = delegator.findOne("PaymentMethodType", [paymentMethodTypeId : paymentMethodTypeId], false); context.paymentMethodType = paymentMethodType; context.paymentMethodTypeId = paymentMethodTypeId; } |
Free forum by Nabble | Edit this page |