DEPRECATION: specialpurpose/ebay: findByPrimaryKey variants replaced

with findOne

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1337674 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adam Heath
2012-05-12 21:20:38 +00:00
parent 162905e200
commit 60ae46f59d
4 changed files with 11 additions and 11 deletions
+4 -4
View File
@@ -516,7 +516,7 @@ public class EbayHelper {
GenericValue postalAddress;
try {
// get the postal address for this contact mech
postalAddress = delegator.findByPrimaryKey("PostalAddress", UtilMisc.toMap("contactMechId", contactMechId));
postalAddress = delegator.findOne("PostalAddress", UtilMisc.toMap("contactMechId", contactMechId), false);
// match values to compare by modifying them the same way they
// were when they were created
@@ -588,8 +588,8 @@ public class EbayHelper {
GenericValue phoneNumber;
try {
// get the phone number for this contact mech
phoneNumber = delegator.findByPrimaryKey("TelecomNumber", UtilMisc
.toMap("contactMechId", contactMechId));
phoneNumber = delegator.findOne("TelecomNumber", UtilMisc
.toMap("contactMechId", contactMechId), false);
// now compare values. If one matches, that's our phone number.
// Return the related contact mech id.
@@ -622,7 +622,7 @@ public class EbayHelper {
titleFirstWord = title.substring(0, title.indexOf(' '));
}
if (UtilValidate.isNotEmpty(titleFirstWord)) {
GenericValue product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", titleFirstWord));
GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", titleFirstWord), false);
if (UtilValidate.isNotEmpty(product)) {
productId = product.getString("productId");
}
@@ -992,7 +992,7 @@ public class EbayOrderServices {
if (productStoreId == null) {
return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.productStoreIdIsMandatory", locale));
} else {
GenericValue productStore = delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId", productStoreId));
GenericValue productStore = delegator.findOne("ProductStore", UtilMisc.toMap("productStoreId", productStoreId), false);
if (productStore != null) {
defaultCurrencyUomId = productStore.getString("defaultCurrencyUomId");
payToPartyId = productStore.getString("payToPartyId");
@@ -1150,7 +1150,7 @@ public class EbayOrderServices {
// if we get a party, check its contact information.
if (UtilValidate.isNotEmpty(partyId)) {
Debug.logInfo("Found existing party associated to the eBay buyer: " + partyId, module);
GenericValue party = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId));
GenericValue party = delegator.findOne("Party", UtilMisc.toMap("partyId", partyId), false);
contactMechId = EbayHelper.setShippingAddressContactMech(dispatcher, delegator, party, userLogin, shippingAddressCtx);
String emailBuyer = (String) context.get("emailBuyer");
@@ -141,7 +141,7 @@ public class ImportOrdersFromEbay {
if (UtilValidate.isNotEmpty(orderId)) {
// Get the order header and verify if this order has been imported
// from eBay (i.e. sales channel = EBAY_CHANNEL and externalId is set)
orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId));
orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false);
if (orderHeader == null) {
Debug.logError("Cannot find order with orderId [" + orderId + "]", module);
return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.errorRetrievingOrderFromOrderId", locale));
@@ -600,7 +600,7 @@ public class ImportOrdersFromEbay {
if (productStoreId == null) {
return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.productStoreIdIsMandatory", locale));
} else {
GenericValue productStore = delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId", productStoreId));
GenericValue productStore = delegator.findOne("ProductStore", UtilMisc.toMap("productStoreId", productStoreId), false);
if (productStore != null) {
defaultCurrencyUomId = productStore.getString("defaultCurrencyUomId");
payToPartyId = productStore.getString("payToPartyId");
@@ -658,7 +658,7 @@ public class ImportOrdersFromEbay {
if (UtilValidate.isEmpty(productId)) {
return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.productIdNotAvailable", locale));
} else {
GenericValue product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId));
GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false);
if (UtilValidate.isEmpty(product)) {
return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.productIdDoesNotExist", locale));
}
@@ -735,7 +735,7 @@ public class ImportOrdersFromEbay {
if (UtilValidate.isNotEmpty(partyAttribute)) {
partyId = (String) partyAttribute.get("partyId");
Debug.logInfo("Found existing party associated to the eBay buyer: " + partyId, module);
GenericValue party = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId));
GenericValue party = delegator.findOne("Party", UtilMisc.toMap("partyId", partyId), false);
contactMechId = EbayHelper.setShippingAddressContactMech(dispatcher, delegator, party, userLogin, parameters);
String emailBuyer = (String) parameters.get("emailBuyer");
+1 -1
View File
@@ -269,7 +269,7 @@ under the License.
</tr>
<#list productFeatureTypeIdsOrdered as productFeatureTypeId>
<#assign findPftMap = Static["org.ofbiz.base.util.UtilMisc"].toMap("productFeatureTypeId", productFeatureTypeId) />
<#assign productFeatureType = delegator.findByPrimaryKeyCache("ProductFeatureType", findPftMap) />
<#assign productFeatureType = delegator.findOne("ProductFeatureType", findPftMap, true) />
<#assign productFeatures = productFeaturesByTypeMap[productFeatureTypeId] />
<tr>
<td class="label" align="right" valign="middle">