Author: jonesde
Date: Sat May 3 02:40:51 2008 New Revision: 653029 URL: http://svn.apache.org/viewvc?rev=653029&view=rev Log: A whole bunch of cleanups to use newer and more consolidated delegator find methods; still lots of deprecation warnings, bots of deprecation warnings but this is a first pass, and things still run as before Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortPartyAssignmentServices.java ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/OfbizStore.java ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonEvents.java ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataAssert.java ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityWatchServices.java ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiSession.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java ofbiz/trunk/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceEngineTestServices.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/GenericWebEvent.java ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/print/FoPrintServerEvents.java ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java 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=653029&r1=653028&r2=653029&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 3 02:40:51 2008 @@ -26,6 +26,7 @@ import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.GenericEntityException; +import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.entity.condition.EntityExpr; import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.entity.condition.EntityConditionList; @@ -39,6 +40,7 @@ import java.util.Map; import java.util.List; +import java.util.Set; import java.math.BigDecimal; import java.sql.Timestamp; @@ -871,7 +873,7 @@ List transList = null; try { - transList = delegator.findByCondition("FinAccountTrans", new EntityConditionList(exprs, EntityOperator.AND), null, null, orderBy, opts); + transList = delegator.findList("FinAccountTrans", new EntityConditionList(exprs, EntityOperator.AND), null, orderBy, opts, false); } catch (GenericEntityException e) { Debug.logError(e, 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=653029&r1=653028&r2=653029&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 3 02:40:51 2008 @@ -153,7 +153,7 @@ new EntityExpr("preferenceStatusId", EntityOperator.NOT_IN, UtilMisc.toList("PAYMENT_SETTLED", "PAYMENT_RECEIVED", "PAYMENT_DECLINED", "PAYMENT_CANCELLED")) // PAYMENT_NOT_AUTH ), EntityOperator.AND); - List orderPaymentPreferenceSums = delegator.findByCondition("OrderPurchasePaymentSummary", whereConditions, null, UtilMisc.toList("maxAmount"), null, null); + List orderPaymentPreferenceSums = delegator.findList("OrderPurchasePaymentSummary", whereConditions, UtilMisc.toSet("maxAmount"), null, null, false); if (orderPaymentPreferenceSums != null) { for (Iterator oppsi = orderPaymentPreferenceSums.iterator(); oppsi.hasNext(); ) { GenericValue orderPaymentPreferenceSum = (GenericValue) oppsi.next(); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java Sat May 3 02:40:51 2008 @@ -305,7 +305,7 @@ request.setAttribute("currentPK", currentPK); GenericValue currentValue = null; try { - currentValue = delegator.findByPrimaryKey(currentPK.getPrimaryKey()); + currentValue = delegator.findOne(currentPK.getEntityName(), currentPK, false); } catch(GenericEntityException e) { } request.setAttribute("currentValue", currentValue); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java Sat May 3 02:40:51 2008 @@ -662,7 +662,7 @@ long result = 0; try { - result = delegator.findCountByCondition("SurveyResponseAndAnswer", makeEliCondition(question), null); + result = delegator.findCountByCondition("SurveyResponseAndAnswer", makeEliCondition(question), null, null); } catch (GenericEntityException e) { Debug.logError(e, module); throw new SurveyWrapperException("Unable to get responses", e); Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java (original) +++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java Sat May 3 02:40:51 2008 @@ -74,7 +74,7 @@ List listResult = null; try { - listResult = delegator.findAll("MrpEvent"); + listResult = delegator.findList("MrpEvent", null, null, null, null, false); //int numOfRecordsRemoved = delegator.removeByCondition("MrpEvent", null); } catch(GenericEntityException e) { Debug.logError(e,"Error : delegator.findAll(\"MrpEvent\")", module); 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=653029&r1=653028&r2=653029&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 3 02:40:51 2008 @@ -450,7 +450,7 @@ new EntityExpr("partyId", EntityOperator.EQUALS, partyId), new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED"), new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "ORDER_CANCELLED")), EntityOperator.AND); - productPromoCustomerUseSize = delegator.findCountByCondition("ProductPromoUseCheck", checkCondition, null); + productPromoCustomerUseSize = delegator.findCountByCondition("ProductPromoUseCheck", checkCondition, null, null); } long perCustomerThisOrder = useLimitPerCustomer.longValue() - productPromoCustomerUseSize; if (candidateUseLimit == null || candidateUseLimit.longValue() > perCustomerThisOrder) { @@ -467,7 +467,7 @@ new EntityExpr("productPromoId", EntityOperator.EQUALS, productPromoId), new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED"), new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "ORDER_CANCELLED")), EntityOperator.AND); - long productPromoUseSize = delegator.findCountByCondition("ProductPromoUseCheck", checkCondition, null); + long productPromoUseSize = delegator.findCountByCondition("ProductPromoUseCheck", checkCondition, null, null); long perPromotionThisOrder = useLimitPerPromotion.longValue() - productPromoUseSize; if (candidateUseLimit == null || candidateUseLimit.longValue() > perPromotionThisOrder) { candidateUseLimit = new Long(perPromotionThisOrder); @@ -494,7 +494,7 @@ new EntityExpr("partyId", EntityOperator.EQUALS, partyId), new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED"), new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "ORDER_CANCELLED")), EntityOperator.AND); - productPromoCustomerUseSize = delegator.findCountByCondition("ProductPromoUseCheck", checkCondition, null); + productPromoCustomerUseSize = delegator.findCountByCondition("ProductPromoUseCheck", checkCondition, null, null); } long perCustomerThisOrder = codeUseLimitPerCustomer.longValue() - productPromoCustomerUseSize; if (codeUseLimit == null || codeUseLimit.longValue() > perCustomerThisOrder) { @@ -509,7 +509,7 @@ new EntityExpr("productPromoCodeId", EntityOperator.EQUALS, productPromoCodeId), new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "ORDER_REJECTED"), new EntityExpr("statusId", EntityOperator.NOT_EQUAL, "ORDER_CANCELLED")), EntityOperator.AND); - long productPromoCodeUseSize = delegator.findCountByCondition("ProductPromoUseCheck", checkCondition, null); + long productPromoCodeUseSize = delegator.findCountByCondition("ProductPromoUseCheck", checkCondition, null, null); long perCodeThisOrder = codeUseLimitPerCode.longValue() - productPromoCodeUseSize; if (codeUseLimit == null || codeUseLimit.longValue() > perCodeThisOrder) { codeUseLimit = new Long(perCodeThisOrder); @@ -555,7 +555,7 @@ validEmailCondList.add(new EntityExpr(new EntityExpr("thruDate", EntityOperator.GREATER_THAN_EQUAL_TO, nowTimestamp), EntityOperator.OR, new EntityExpr("thruDate", EntityOperator.EQUALS, null))); EntityCondition validEmailCondition = new EntityConditionList(validEmailCondList, EntityOperator.AND); - long validEmailCount = delegator.findCountByCondition("ProductPromoCodeEmailParty", validEmailCondition, null); + long validEmailCount = delegator.findCountByCondition("ProductPromoCodeEmailParty", validEmailCondition, null, null); if (validEmailCount > 0) { // there was an email in the list, looks good... return null; Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java (original) +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java Sat May 3 02:40:51 2008 @@ -66,7 +66,7 @@ partyRelationshipType.set("partyRelationshipName", context.get("partyRelationshipName"), false); try { - if (delegator.findByPrimaryKey(partyRelationshipType.getPrimaryKey()) != null) { + if (delegator.findOne(partyRelationshipType.getEntityName(), partyRelationshipType.getPrimaryKey(), false) != null) { return ServiceUtil.returnError("Could not create party relationship type: already exists"); } } catch (GenericEntityException e) { Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryWorker.java Sat May 3 02:40:51 2008 @@ -94,7 +94,7 @@ Collection results = new LinkedList(); try { - Collection allCategories = delegator.findAll("ProductCategory"); + Collection allCategories = delegator.findList("ProductCategory", null, null, null, null, false); if (allCategories == null) return; @@ -236,7 +236,7 @@ GenericDelegator delegator = category.getDelegator(); long count = 0; try { - count = delegator.findCountByCondition("ProductCategoryMember", buildCountCondition("productCategoryId", category.getString("productCategoryId")), null); + count = delegator.findCountByCondition("ProductCategoryMember", buildCountCondition("productCategoryId", category.getString("productCategoryId")), null, null); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -248,7 +248,7 @@ GenericDelegator delegator = category.getDelegator(); long count = 0; try { - count = delegator.findCountByCondition("ProductCategoryRollup", buildCountCondition("parentProductCategoryId", category.getString("productCategoryId")), null); + count = delegator.findCountByCondition("ProductCategoryRollup", buildCountCondition("parentProductCategoryId", category.getString("productCategoryId")), null, null); } catch (GenericEntityException e) { Debug.logError(e, module); } Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java Sat May 3 02:40:51 2008 @@ -727,7 +727,7 @@ if (facilityId != null) { facilities = delegator.findByAnd("Facility", UtilMisc.toMap("facilityId", facilityId)); } else { - facilities = delegator.findAll("Facility"); + facilities = delegator.findList("Facility", null, null, null, null, false); } } catch (GenericEntityException e) { return ServiceUtil.returnError("Unable to locate facilities." + e.getMessage()); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductEvents.java Sat May 3 02:40:51 2008 @@ -116,10 +116,10 @@ beganTx = TransactionUtil.begin(7200); try { if (Debug.infoOn()) { - long count = delegator.findCountByCondition("Product", condition, null); + long count = delegator.findCountByCondition("Product", condition, null, null); Debug.logInfo("========== Found " + count + " products to index ==========", module); } - entityListIterator = delegator.findListIteratorByCondition("Product", condition, null, null); + entityListIterator = delegator.find("Product", condition, null, null, null, null); } catch (GenericEntityException gee) { Debug.logWarning(gee, gee.getMessage(), module); Map messageMap = UtilMisc.toMap("gee", gee.toString()); @@ -277,7 +277,7 @@ GenericValue productAssoc = null; try { - productAssoc = delegator.findByPrimaryKey(tempProductAssoc.getPrimaryKey()); + productAssoc = delegator.findOne(tempProductAssoc.getEntityName(), tempProductAssoc.getPrimaryKey(), false); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); productAssoc = null; @@ -350,7 +350,7 @@ GenericValue productAssoc = null; try { - productAssoc = delegator.findByPrimaryKey(tempProductAssoc.getPrimaryKey()); + productAssoc = delegator.findOne(tempProductAssoc.getEntityName(), tempProductAssoc.getPrimaryKey(), false); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); productAssoc = null; Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java Sat May 3 02:40:51 2008 @@ -740,7 +740,7 @@ new EntityExpr("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, nowTimestamp), new EntityExpr(new EntityExpr("thruDate", EntityOperator.EQUALS, null), EntityOperator.OR, new EntityExpr("thruDate", EntityOperator.GREATER_THAN_EQUAL_TO, nowTimestamp)) ), EntityOperator.AND); - if (delegator.findCountByCondition("ProductFeatureGroupAppl", condition, null) == 0) { + if (delegator.findCountByCondition("ProductFeatureGroupAppl", condition, null, null) == 0) { // if no valid ones, create one GenericValue productFeatureGroupAppl = delegator.makeValue("ProductFeatureGroupAppl", UtilMisc.toMap("productFeatureGroupId", productFeatureGroupId, "productFeatureId", productFeatureId, "fromDate", nowTimestamp)); productFeatureGroupAppl.create(); @@ -768,7 +768,7 @@ new EntityExpr("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, nowTimestamp), new EntityExpr(new EntityExpr("thruDate", EntityOperator.EQUALS, null), EntityOperator.OR, new EntityExpr("thruDate", EntityOperator.GREATER_THAN_EQUAL_TO, nowTimestamp)) ), EntityOperator.AND); - if (delegator.findCountByCondition("ProductFeatureCatGrpAppl", checkCondition, null) == 0) { + if (delegator.findCountByCondition("ProductFeatureCatGrpAppl", checkCondition, null, null) == 0) { // if no valid ones, create one GenericValue productFeatureGroupAppl = delegator.makeValue("ProductFeatureCatGrpAppl", UtilMisc.toMap("productFeatureGroupId", productFeatureGroupId, "productCategoryId", productCategoryId, "fromDate", nowTimestamp)); productFeatureGroupAppl.create(); Modified: ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java (original) +++ ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/login/LoginEvents.java Sat May 3 02:40:51 2008 @@ -134,7 +134,7 @@ GenericValue supposedUserLogin = null; try { - supposedUserLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userLoginId)); + supposedUserLogin = delegator.findOne("UserLogin", false, "userLoginId", userLoginId); } catch (GenericEntityException gee) { Debug.logWarning(gee, "", module); } @@ -199,7 +199,7 @@ String passwordToSend = null; try { - supposedUserLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userLoginId)); + supposedUserLogin = delegator.findOne("UserLogin", false, "userLoginId", userLoginId); if (supposedUserLogin == null) { // the Username was not found errMsg = UtilProperties.getMessage(resource, "loginevents.username_not_found_reenter", UtilHttp.getLocale(request)); @@ -259,7 +259,7 @@ // get the ProductStore email settings GenericValue productStoreEmail = null; try { - productStoreEmail = delegator.findByPrimaryKey("ProductStoreEmailSetting", UtilMisc.toMap("productStoreId", productStoreId, "emailType", "PRDS_PWD_RETRIEVE")); + productStoreEmail = delegator.findOne("ProductStoreEmailSetting", false, "productStoreId", productStoreId, "emailType", "PRDS_PWD_RETRIEVE"); } catch (GenericEntityException e) { Debug.logError(e, "Problem getting ProductStoreEmailSetting", module); } Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortPartyAssignmentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortPartyAssignmentServices.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortPartyAssignmentServices.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortPartyAssignmentServices.java Sat May 3 02:40:51 2008 @@ -43,7 +43,7 @@ GenericValue workEffort = null; try { - workEffort = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", wepa.get("workEffortId"))); + workEffort = delegator.findOne("WorkEffort", false, "workEffortId", wepa.get("workEffortId")); } catch (GenericEntityException e) { Debug.logWarning(e, module); } Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java Sat May 3 02:40:51 2008 @@ -258,7 +258,7 @@ GenericValue workEffort = null; try { - workEffort = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId)); + workEffort = delegator.findOne("WorkEffort", false, "workEffortId", workEffortId); } catch (GenericEntityException e) { Debug.logWarning(e, module); } Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java (original) +++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java Sat May 3 02:40:51 2008 @@ -57,7 +57,7 @@ GenericValue workEffort = null; try { - workEffort = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId)); + workEffort = delegator.findOne("WorkEffort", false, "workEffortId", workEffortId); } catch (GenericEntityException e) { Debug.logWarning(e, module); } Modified: ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/OfbizStore.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/OfbizStore.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/OfbizStore.java (original) +++ ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/OfbizStore.java Sat May 3 02:40:51 2008 @@ -78,7 +78,7 @@ public String[] keys() throws IOException { List<GenericValue> sessions = null; try { - sessions = delegator.findAll(entityName); + sessions = delegator.findList(entityName, null, null, null, null, false); } catch (GenericEntityException e) { throw new IOException(e.getMessage()); } @@ -100,7 +100,7 @@ StandardSession _session = null; GenericValue sessionValue = null; try { - sessionValue = delegator.findByPrimaryKey(entityName, "sessionId", id); + sessionValue = delegator.findOne(entityName, false, "sessionId", id); } catch (GenericEntityException e) { throw new IOException(e.getMessage()); } Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonEvents.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonEvents.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonEvents.java Sat May 3 02:40:51 2008 @@ -59,7 +59,7 @@ GenericValue visit = null; try { - visit = delegator.findByPrimaryKey("Visit", UtilMisc.toMap("visitId", visitId)); + visit = delegator.findOne("Visit", false, "visitId", visitId); } catch (GenericEntityException e) { Debug.logError(e, "Cannot Visit Object", module); } @@ -93,7 +93,7 @@ GenericValue visit = null; try { - visit = delegator.findByPrimaryKey("Visit", UtilMisc.toMap("visitId", visitId)); + visit = delegator.findOne("Visit", false, "visitId", visitId); } catch (GenericEntityException e) { Debug.logError(e, "Cannot Visit Object", module); } Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java Sat May 3 02:40:51 2008 @@ -103,11 +103,7 @@ try { // only get userLogin from cache for service calls; for web and other manual logins there is less time sensitivity - if (isServiceAuth) { - userLogin = delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId", username)); - } else { - userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", username)); - } + userLogin = delegator.findOne("UserLogin", isServiceAuth, "userLoginId", username); } catch (GenericEntityException e) { Debug.logWarning(e, "", module); } @@ -434,7 +430,7 @@ GenericValue party = null; try { - party = delegator.findByPrimaryKey("Party", UtilMisc.toMap("partyId", partyId)); + party = delegator.findOne("Party", false, "partyId", partyId); } catch (GenericEntityException e) { Debug.logWarning(e, "", module); } @@ -533,7 +529,7 @@ GenericValue userLoginToUpdate = null; try { - userLoginToUpdate = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userLoginId)); + userLoginToUpdate = delegator.findOne("UserLogin", false, "userLoginId", userLoginId); } catch (GenericEntityException e) { Map messageMap = UtilMisc.toMap("errorMessage", e.getMessage()); errMsg = UtilProperties.getMessage(resource,"loginservices.could_not_change_password_read_failure", messageMap, locale); @@ -638,7 +634,7 @@ // check to see if there's a matching login and use it if it's for the same party try { - newUserLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userLoginId)); + newUserLogin = delegator.findOne("UserLogin", false, "userLoginId", userLoginId); } catch (GenericEntityException e) { Debug.logWarning(e, "", module); Map messageMap = UtilMisc.toMap("errorMessage", e.getMessage()); @@ -726,7 +722,7 @@ GenericValue userLoginToUpdate = null; try { - userLoginToUpdate = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userLoginId)); + userLoginToUpdate = delegator.findOne("UserLogin", false, "userLoginId", userLoginId); } catch (GenericEntityException e) { Map messageMap = UtilMisc.toMap("errorMessage", e.getMessage()); errMsg = UtilProperties.getMessage(resource,"loginservices.could_not_change_password_read_failure", messageMap, locale); Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java Sat May 3 02:40:51 2008 @@ -110,12 +110,12 @@ // make sure we have a full primary key, if any field is null then just log a warning and return null instead of blowing up if (entityPK.containsPrimaryKey(true)) { if (useCacheBool) { - valueOut = delegator.findByPrimaryKeyCache(entityPK); + valueOut = delegator.findOne(entityPK.getEntityName(), entityPK, true); } else { if (fieldsToSelect != null) { valueOut = delegator.findByPrimaryKeyPartial(entityPK, fieldsToSelect); } else { - valueOut = delegator.findByPrimaryKey(entityPK); + valueOut = delegator.findOne(entityPK.getEntityName(), entityPK, false); } } } else { Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/test/EntityTestSuite.java Sat May 3 02:40:51 2008 @@ -20,11 +20,9 @@ import java.sql.Timestamp; import java.util.ArrayList; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.lang.Thread; import junit.framework.TestCase; @@ -40,10 +38,10 @@ import org.ofbiz.entity.condition.EntityConditionList; import org.ofbiz.entity.condition.EntityExpr; import org.ofbiz.entity.condition.EntityOperator; -import org.ofbiz.entity.util.EntityFindOptions; -import org.ofbiz.entity.util.EntityListIterator; import org.ofbiz.entity.transaction.GenericTransactionException; import org.ofbiz.entity.transaction.TransactionUtil; +import org.ofbiz.entity.util.EntityFindOptions; +import org.ofbiz.entity.util.EntityListIterator; public class EntityTestSuite extends TestCase { @@ -85,7 +83,7 @@ delegator.storeAll(newValues); // finds a List of newly created values. the second parameter specifies the fields to order results by. - List<GenericValue> newlyCreatedValues = delegator.findAll("TestingType", UtilMisc.toList("testingTypeId")); + List<GenericValue> newlyCreatedValues = delegator.findList("TestingType", null, null, UtilMisc.toList("testingTypeId"), null, false); TestCase.assertEquals("4 TestingTypes found", 4, newlyCreatedValues.size()); } catch (GenericEntityException ex) { TestCase.fail(ex.getMessage()); @@ -99,7 +97,7 @@ try { // retrieve a sample GenericValue, make sure it's correct - GenericValue testValue = delegator.findByPrimaryKey("TestingType", "testingTypeId", "TEST-1"); + GenericValue testValue = delegator.findOne("TestingType", false, "testingTypeId", "TEST-1"); TestCase.assertEquals("Retrieved value has the correct description", testValue.getString("description"), "Testing Type #1"); // now update and store it @@ -107,7 +105,7 @@ testValue.store(); // now retrieve it again and make sure that the updated value is correct - testValue = delegator.findByPrimaryKey("TestingType", "testingTypeId", "TEST-1"); + testValue = delegator.findOne("TestingType", false, "testingTypeId", "TEST-1"); TestCase.assertEquals("Retrieved value has the correct description", testValue.getString("description"), "New Testing Type #1"); } catch (GenericEntityException ex) { @@ -122,7 +120,7 @@ try { // get how many child nodes did we have before creating the tree EntityCondition isChild = new EntityExpr("primaryParentNodeId", EntityOperator.NOT_EQUAL, GenericEntity.NULL_FIELD); - long alreadyStored = delegator.findCountByCondition("TestingNode", isChild, null); + long alreadyStored = delegator.findCountByCondition("TestingNode", isChild, null, null); // // The tree has a root, the root has level1max children. @@ -146,7 +144,7 @@ } long created = level1; - long newlyStored = delegator.findCountByCondition("TestingNode", isChild, null); + long newlyStored = delegator.findCountByCondition("TestingNode", isChild, null, null); // Normally, newlyStored = alreadyStored + created TestCase.assertEquals("Created/Stored Nodes", newlyStored, created + alreadyStored); @@ -161,7 +159,7 @@ public void testAddMembersToTree() throws Exception { // get the level1 nodes EntityCondition isLevel1 = new EntityExpr("primaryParentNodeId", EntityOperator.NOT_EQUAL, GenericEntity.NULL_FIELD); - List<GenericValue> nodeLevel1 = delegator.findByCondition("TestingNode", isLevel1, null, null); + List<GenericValue> nodeLevel1 = delegator.findList("TestingNode", isLevel1, null, null, null, false); List<GenericValue> newValues = new LinkedList<GenericValue>(); Timestamp now = UtilDateTime.nowTimestamp(); @@ -197,7 +195,7 @@ */ public void testCountViews() throws Exception { EntityCondition isNodeWithMember = new EntityExpr("testingId", EntityOperator.NOT_EQUAL, GenericEntity.NULL_FIELD); - List<GenericValue> nodeWithMembers = delegator.findByCondition("TestingNodeAndMember", isNodeWithMember, null, null); + List<GenericValue> nodeWithMembers = delegator.findList("TestingNodeAndMember", isNodeWithMember, null, null, null, false); for (GenericValue v: nodeWithMembers) { Map<String, Object> fields = v.getAllFields(); @@ -209,7 +207,7 @@ Debug.logInfo(field.toString() + " = " + ((value == null) ? "[null]" : value), module); } } - long testingcount = delegator.findCountByCondition("Testing", null, null); + long testingcount = delegator.findCountByCondition("Testing", null, null, null); TestCase.assertEquals("Number of views should equal number of created entities in the test.", nodeWithMembers.size(), testingcount); } @@ -226,7 +224,7 @@ EntityFindOptions findOptions = new EntityFindOptions(); findOptions.setDistinct(true); - List<GenericValue> testingSize10 = delegator.findByCondition("Testing", condition, null, UtilMisc.toList("testingSize", "comments"), null, findOptions); + List<GenericValue> testingSize10 = delegator.findList("Testing", condition, UtilMisc.toSet("testingSize", "comments"), null, findOptions, false); Debug.logInfo("testingSize10 is " + testingSize10.size(), module); TestCase.assertEquals("There should only be 1 result found by findDistinct()", testingSize10.size(), 1); @@ -237,7 +235,7 @@ */ public void testNotLike() throws Exception { EntityCondition cond = new EntityExpr("description", EntityOperator.NOT_LIKE, "root%"); - List<GenericValue> nodes = delegator.findByCondition("TestingNode", cond, null, null); + List<GenericValue> nodes = delegator.findList("TestingNode", cond, null, null, null, false); TestCase.assertTrue("Found nodes", nodes != null); for (GenericValue product: nodes) { @@ -281,8 +279,7 @@ // // Find the testing entities tru the node member and build a list of them // - List<GenericValue> values = delegator.findAll("TestingNodeMember"); - Iterator i = values.iterator(); + List<GenericValue> values = delegator.findList("TestingNodeMember", null, null, null, null, false); ArrayList<GenericValue> testings = new ArrayList<GenericValue>(); @@ -291,11 +288,11 @@ } // and remove the nodeMember afterwards delegator.removeAll(values); - values = delegator.findAll("TestingNodeMember"); + values = delegator.findList("TestingNodeMember", null, null, null, null, false); TestCase.assertTrue("No more Node Member entities", values.size() == 0); delegator.removeAll(testings); - values = delegator.findAll("Testing"); + values = delegator.findList("Testing", null, null, null, null, false); TestCase.assertTrue("No more Testing entities", values.size() == 0); } @@ -346,7 +343,7 @@ // delete them their primary key // EntityCondition isRoot = new EntityExpr("primaryParentNodeId", EntityOperator.EQUALS, GenericEntity.NULL_FIELD); - List<GenericValue> rootValues = delegator.findByCondition("TestingNode", isRoot, UtilMisc.toList("testingNodeId"), null); + List<GenericValue> rootValues = delegator.findList("TestingNode", isRoot, UtilMisc.toSet("testingNodeId"), null, null, false); for (GenericValue value: rootValues) { GenericPK pk = value.getPrimaryKey(); @@ -356,7 +353,7 @@ // no more TestingNode should be in the data base anymore. - List<GenericValue> testingNodes = delegator.findAll("TestingNode"); + List<GenericValue> testingNodes = delegator.findList("TestingNode", null, null, null, null, false); TestCase.assertEquals("No more TestingNode after removing the roots", testingNodes.size(), 0); } @@ -364,11 +361,11 @@ * Tests the .removeAll method only. */ public void testRemoveType() throws Exception { - List<GenericValue> values = delegator.findAll("TestingType"); + List<GenericValue> values = delegator.findList("TestingType", null, null, null, null, false); delegator.removeAll(values); // now make sure there are no more of these - values = delegator.findAll("TestingType"); + values = delegator.findList("TestingType", null, null, null, null, false); TestCase.assertEquals("No more TestingTypes after remove all", values.size(), 0); } @@ -382,13 +379,13 @@ newValues.add(delegator.makeValue("Testing", "testingId", getTestId("T1-", i))); } delegator.storeAll(newValues); - List<GenericValue> newlyCreatedValues = delegator.findAll("Testing", UtilMisc.toList("testingId")); + List<GenericValue> newlyCreatedValues = delegator.findList("Testing", null, null, UtilMisc.toList("testingId"), null, false); TestCase.assertEquals("Test to create " + TEST_COUNT + " and store all at once", TEST_COUNT, newlyCreatedValues.size()); } catch (GenericEntityException e) { assertTrue("GenericEntityException:" + e.toString(), false); return; } finally { - List<GenericValue> newlyCreatedValues = delegator.findAll("Testing", UtilMisc.toList("testingId")); + List<GenericValue> newlyCreatedValues = delegator.findList("Testing", null, null, UtilMisc.toList("testingId"), null, false); delegator.removeAll(newlyCreatedValues); } } @@ -414,7 +411,7 @@ */ public void testEntityListIterator() throws Exception { try { - EntityListIterator iterator = delegator.findListIteratorByCondition("Testing", new EntityExpr("testingId", EntityOperator.LIKE, "T2-%"), null, null); + EntityListIterator iterator = delegator.find("Testing", new EntityExpr("testingId", EntityOperator.LIKE, "T2-%"), null, null, null, null); assertTrue("Test if EntityListIterator was created: ", iterator != null); int i = 0; @@ -430,7 +427,7 @@ assertTrue("GenericEntityException:" + e.toString(), false); return; } finally { - List<GenericValue> entitiesToRemove = delegator.findByCondition("Testing", new EntityExpr("testingId", EntityOperator.LIKE, "T2-%"), null, null); + List<GenericValue> entitiesToRemove = delegator.findList("Testing", new EntityExpr("testingId", EntityOperator.LIKE, "T2-%"), null, null, null, false); delegator.removeAll(entitiesToRemove); } } @@ -444,7 +441,7 @@ boolean transBegin = TransactionUtil.begin(); delegator.create(testValue); TransactionUtil.rollback(transBegin, null, null); - GenericValue testValueOut = delegator.findByPrimaryKey("Testing", "testingId", "rollback-test"); + GenericValue testValueOut = delegator.findOne("Testing", false, "testingId", "rollback-test"); assertEquals("Test that transaction rollback removes value: ", testValueOut, null); } catch (GenericEntityException e) { assertTrue("GenericEntityException:" + e.toString(), false); @@ -505,7 +502,7 @@ assertTrue("GenericEntityException:" + ex.toString(), false); return; } finally { - List<GenericValue> allTestBlobs = delegator.findAll("TestBlob"); + List<GenericValue> allTestBlobs = delegator.findList("TestBlob", null, null, null, null, false); delegator.removeAll(allTestBlobs); } } @@ -526,7 +523,7 @@ TestCase.fail(ex.getMessage()); } finally { // Remove all our newly inserted values. - List<GenericValue> values = delegator.findAll("TestBlob"); + List<GenericValue> values = delegator.findList("TestBlob", null, null, null, null, false); delegator.removeAll(values); } } @@ -551,5 +548,4 @@ strBufTemp.append(iNum); return strBufTemp.toString(); } - } Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java Sat May 3 02:40:51 2008 @@ -102,7 +102,7 @@ protected SecretKey getKeyFromStore(String keyName) throws EntityCryptoException { GenericValue keyValue = null; try { - keyValue = delegator.findByPrimaryKey("EntityKeyStore", "keyName", keyName); + keyValue = delegator.findOne("EntityKeyStore", false, "keyName", keyName); } catch (GenericEntityException e) { throw new EntityCryptoException(e); } Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataAssert.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataAssert.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataAssert.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityDataAssert.java Sat May 3 02:40:51 2008 @@ -88,7 +88,7 @@ try { checkPK = checkValue.getPrimaryKey(); - GenericValue currentValue = delegator.findByPrimaryKey(checkPK); + GenericValue currentValue = delegator.findOne(checkPK.getEntityName(), checkPK, false); if (currentValue == null) { errorMessages.add("Entity [" + checkPK.getEntityName() + "] record not found for pk: " + checkPK); return; Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityWatchServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityWatchServices.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityWatchServices.java (original) +++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/EntityWatchServices.java Sat May 3 02:40:51 2008 @@ -62,7 +62,7 @@ GenericValue currentValue = null; try { - currentValue = dctx.getDelegator().findByPrimaryKey(newValue.getPrimaryKey()); + currentValue = dctx.getDelegator().findOne(newValue.getEntityName(), newValue.getPrimaryKey(), false); } catch (GenericEntityException e) { String errMsg = "Error finding currentValue for primary key [" + newValue.getPrimaryKey() + "]: " + e.toString(); Debug.logError(e, errMsg, module); Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java (original) +++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java Sat May 3 02:40:51 2008 @@ -164,7 +164,7 @@ } try { - this.entitySync = delegator.findByPrimaryKey("EntitySync", UtilMisc.toMap("entitySyncId", this.entitySyncId)); + this.entitySync = delegator.findOne("EntitySync", false, "entitySyncId", this.entitySyncId); if (this.entitySync == null) { throw new SyncAbortException("Not running EntitySync [" + entitySyncId + "], no record found with that ID."); } @@ -1010,7 +1010,7 @@ } else { try { // set the latest values from the EntitySyncHistory, based on the values on the EntitySync - GenericValue entitySyncHistory = delegator.findByPrimaryKey("EntitySyncHistory", UtilMisc.toMap("entitySyncId", entitySyncId, "startDate", startDate)); + GenericValue entitySyncHistory = delegator.findOne("EntitySyncHistory", false, "entitySyncId", entitySyncId, "startDate", startDate); this.toCreateInserted = UtilMisc.toLong(entitySyncHistory.getLong("toCreateInserted")); this.toCreateUpdated = UtilMisc.toLong(entitySyncHistory.getLong("toCreateUpdated")); this.toCreateNotUpdated = UtilMisc.toLong(entitySyncHistory.getLong("toCreateNotUpdated")); Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java (original) +++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java Sat May 3 02:40:51 2008 @@ -167,7 +167,7 @@ // check to make sure all foreign keys are created; if not create dummy values as place holders valueToCreate.checkFks(true); - GenericValue existingValue = delegator.findByPrimaryKey(valueToCreate.getPrimaryKey()); + GenericValue existingValue = delegator.findOne(valueToCreate.getEntityName(), valueToCreate.getPrimaryKey(), false); if (existingValue == null) { delegator.create(valueToCreate); toCreateInserted++; @@ -194,7 +194,7 @@ // check to make sure all foreign keys are created; if not create dummy values as place holders valueToStore.checkFks(true); - GenericValue existingValue = delegator.findByPrimaryKey(valueToStore.getPrimaryKey()); + GenericValue existingValue = delegator.findOne(valueToStore.getEntityName(), valueToStore.getPrimaryKey(), false); if (existingValue == null) { delegator.create(valueToStore); toStoreInserted++; @@ -603,7 +603,7 @@ // find the largest keepRemoveInfoHours value on an EntitySyncRemove and kill everything before that, if none found default to 10 days (240 hours) double keepRemoveInfoHours = 24; - List entitySyncRemoveList = delegator.findAll("EntitySync"); + List entitySyncRemoveList = delegator.findList("EntitySync", null, null, null, null, false); Iterator entitySyncRemoveIter = entitySyncRemoveList.iterator(); while (entitySyncRemoveIter.hasNext()) { GenericValue entitySyncRemove = (GenericValue) entitySyncRemoveIter.next(); Modified: ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiSession.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiSession.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiSession.java (original) +++ ofbiz/trunk/framework/guiapp/src/org/ofbiz/guiapp/xui/XuiSession.java Sat May 3 02:40:51 2008 @@ -159,7 +159,7 @@ String partyId = userLogin.getString("partyId"); GenericValue partyRole = null; try { - partyRole = delegator.findByPrimaryKey("PartyRole", UtilMisc.toMap("partyId", partyId, "roleTypeId", roleTypeId)); + partyRole = delegator.findOne("PartyRole", false, "partyId", partyId, "roleTypeId", roleTypeId); } catch (GenericEntityException e) { Debug.logError(e, module); return false; Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/EntityCount.java Sat May 3 02:40:51 2008 @@ -100,7 +100,7 @@ havingEntityCondition = this.havingCondition.createCondition(context, entityName, delegator); } - long count = delegator.findCountByCondition(entityName, whereEntityCondition, havingEntityCondition); + long count = delegator.findCountByCondition(entityName, whereEntityCondition, havingEntityCondition, null); this.countAcsr.put(context, new Long(count)); } catch (GeneralException e) { Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByPrimaryKey.java Sat May 3 02:40:51 2008 @@ -18,6 +18,7 @@ *******************************************************************************/ package org.ofbiz.minilang.method.entityops; +import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -75,20 +76,16 @@ entityName = inEntity.getEntityName(); } - List fieldsToSelectList = null; + Collection fieldsToSelectList = null; if (!fieldsToSelectListAcsr.isEmpty()) { - fieldsToSelectList = (List) fieldsToSelectListAcsr.get(methodContext); + fieldsToSelectList = (Collection) fieldsToSelectListAcsr.get(methodContext); } try { if (fieldsToSelectList != null) { - valueAcsr.put(methodContext, delegator.findByPrimaryKeyPartial(delegator.makePK("Product", inMap), new HashSet(fieldsToSelectList))); + valueAcsr.put(methodContext, delegator.findByPrimaryKeyPartial(delegator.makePK(entityName, inMap), new HashSet(fieldsToSelectList))); } else { - if (useCache) { - valueAcsr.put(methodContext, delegator.findByPrimaryKeyCache(entityName, inMap)); - } else { - valueAcsr.put(methodContext, delegator.findByPrimaryKey(entityName, inMap)); - } + valueAcsr.put(methodContext, delegator.findOne(entityName, inMap, useCache)); } } catch (GenericEntityException e) { Debug.logError(e, module); Modified: ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java (original) +++ ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java Sat May 3 02:40:51 2008 @@ -100,10 +100,11 @@ if (exists == null) { try { - if (delegator.findByPrimaryKey(securityGroupPermissionValue.getPrimaryKey()) != null) + if (delegator.findOne(securityGroupPermissionValue.getEntityName(), securityGroupPermissionValue, false) != null) { exists = Boolean.TRUE; - else + } else { exists = Boolean.FALSE; + } } catch (GenericEntityException e) { exists = Boolean.FALSE; Debug.logWarning(e, module); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/ServiceUtil.java Sat May 3 02:40:51 2008 @@ -500,7 +500,7 @@ GenericValue job = null; try { - job = delegator.findByPrimaryKey("JobSandbox", fields); + job = delegator.findOne("JobSandbox", fields, false); if (job != null) { job.set("cancelDateTime", UtilDateTime.nowTimestamp()); job.set("statusId", "SERVICE_CANCELLED"); @@ -538,7 +538,7 @@ GenericValue job = null; try { - job = delegator.findByPrimaryKey("JobSandbox", fields); + job = delegator.findOne("JobSandbox", fields, false); if (job != null) { job.set("maxRetry", Long.valueOf(0)); job.store(); @@ -620,7 +620,7 @@ Map fields = UtilMisc.toMap("jobId", jobId); GenericValue job; try { - job = delegator.findByPrimaryKey("JobSandbox", fields); + job = delegator.findOne("JobSandbox", fields, false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/job/PersistedServiceJob.java Sat May 3 02:40:51 2008 @@ -269,7 +269,7 @@ // gets the job value object private GenericValue getJob() throws InvalidJobException { try { - GenericValue jobObj = delegator.findByPrimaryKey("JobSandbox", "jobId", getJobId()); + GenericValue jobObj = delegator.findOne("JobSandbox", false, "jobId", getJobId()); if (jobObj == null) { throw new InvalidJobException("Job [" + getJobId() + "] came back null from datasource"); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java Sat May 3 02:40:51 2008 @@ -95,7 +95,7 @@ // load the userLogin object String runAsUser = ContainerConfig.getPropertyValue(cfg, "run-as-user", "system"); try { - this.userLogin = delegator.findByPrimaryKey("UserLogin", "userLoginId", runAsUser); + this.userLogin = delegator.findOne("UserLogin", false, "userLoginId", runAsUser); } catch (GenericEntityException e) { Debug.logError(e, "Unable to load run-as-user UserLogin; cannot start container", module); return false; Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/semaphore/ServiceSemaphore.java Sat May 3 02:40:51 2008 @@ -103,7 +103,7 @@ GenericValue semaphore; try { - semaphore = delegator.findByPrimaryKey("ServiceSemaphore", "serviceName", model.name); + semaphore = delegator.findOne("ServiceSemaphore", false, "serviceName", model.name); } catch (GenericEntityException e) { throw new SemaphoreFailException(e); } Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceEngineTestServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceEngineTestServices.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceEngineTestServices.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/test/ServiceEngineTestServices.java Sat May 3 02:40:51 2008 @@ -72,7 +72,7 @@ try { // grab entity SVCLRT_A by changing, then wait, then find and change SVCLRT_B - GenericValue testingTypeA = delegator.findByPrimaryKey("TestingType", "testingTypeId", "SVCLRT_A"); + GenericValue testingTypeA = delegator.findOne("TestingType", false, "testingTypeId", "SVCLRT_A"); testingTypeA.set("description", "New description for SVCLRT_A"); testingTypeA.store(); @@ -81,12 +81,12 @@ UtilMisc.staticWait(100); Debug.logInfo("In testServiceDeadLockRetryThreadA done with wait, updating SVCLRT_B", module); - GenericValue testingTypeB = delegator.findByPrimaryKey("TestingType", "testingTypeId", "SVCLRT_B"); + GenericValue testingTypeB = delegator.findOne("TestingType", false, "testingTypeId", "SVCLRT_B"); testingTypeB.set("description", "New description for SVCLRT_B"); testingTypeB.store(); Debug.logInfo("In testServiceDeadLockRetryThreadA done with updating SVCLRT_B, updating SVCLRT_AONLY", module); - GenericValue testingTypeAOnly = delegator.findByPrimaryKey("TestingType", "testingTypeId", "SVCLRT_AONLY"); + GenericValue testingTypeAOnly = delegator.findOne("TestingType", false, "testingTypeId", "SVCLRT_AONLY"); testingTypeAOnly.set("description", "New description for SVCLRT_AONLY; this is only changed by thread A so if it doesn't match something happened to thread A!"); testingTypeAOnly.store(); } catch (GenericEntityException e) { @@ -106,7 +106,7 @@ try { // grab entity SVCLRT_B by changing, then wait, then change SVCLRT_A - GenericValue testingTypeB = delegator.findByPrimaryKey("TestingType", "testingTypeId", "SVCLRT_B"); + GenericValue testingTypeB = delegator.findOne("TestingType", false, "testingTypeId", "SVCLRT_B"); testingTypeB.set("description", "New description for SVCLRT_B"); testingTypeB.store(); @@ -115,12 +115,12 @@ UtilMisc.staticWait(100); Debug.logInfo("In testServiceDeadLockRetryThreadB done with wait, updating SVCLRT_A", module); - GenericValue testingTypeA = delegator.findByPrimaryKey("TestingType", "testingTypeId", "SVCLRT_A"); + GenericValue testingTypeA = delegator.findOne("TestingType", false, "testingTypeId", "SVCLRT_A"); testingTypeA.set("description", "New description for SVCLRT_A"); testingTypeA.store(); Debug.logInfo("In testServiceDeadLockRetryThreadA done with updating SVCLRT_A, updating SVCLRT_BONLY", module); - GenericValue testingTypeAOnly = delegator.findByPrimaryKey("TestingType", "testingTypeId", "SVCLRT_BONLY"); + GenericValue testingTypeAOnly = delegator.findOne("TestingType", false, "testingTypeId", "SVCLRT_BONLY"); testingTypeAOnly.set("description", "New description for SVCLRT_BONLY; this is only changed by thread B so if it doesn't match something happened to thread B!"); testingTypeAOnly.store(); } catch (GenericEntityException e) { @@ -170,7 +170,7 @@ try { // grab entity SVCLWTRT by changing, then wait a LONG time, ie more than the wait timeout - GenericValue testingType = delegator.findByPrimaryKey("TestingType", "testingTypeId", "SVCLWTRT"); + GenericValue testingType = delegator.findOne("TestingType", false, "testingTypeId", "SVCLWTRT"); testingType.set("description", "New description for SVCLWTRT from the GRABBER service, this should be replaced by Waiter service in the service engine auto-retry"); testingType.store(); @@ -201,7 +201,7 @@ Debug.logInfo("In testServiceLockWaitTimeoutRetryWaiter about to update SVCLWTRT, wait starts here", module); // TRY grab entity SVCLWTRT by looking up and changing, should get a lock wait timeout exception because of the Grabber thread - GenericValue testingType = delegator.findByPrimaryKey("TestingType", "testingTypeId", "SVCLWTRT"); + GenericValue testingType = delegator.findOne("TestingType", false, "testingTypeId", "SVCLWTRT"); testingType.set("description", "New description for SVCLWTRT from Waiter service, this is the value that should be there."); testingType.store(); @@ -242,7 +242,7 @@ LocalDispatcher dispatcher = dctx.getDispatcher(); try { // grab entity SVCLWTRTCR by changing, then wait a LONG time, ie more than the wait timeout - GenericValue testingType = delegator.findByPrimaryKey("TestingType", "testingTypeId", "SVCLWTRTCR"); + GenericValue testingType = delegator.findOne("TestingType", false, "testingTypeId", "SVCLWTRTCR"); testingType.set("description", "New description for SVCLWTRTCR from Lock Wait Timeout Lock GRABBER, this should be replaced by the one in the Waiter service."); testingType.store(); @@ -272,7 +272,7 @@ Debug.logInfo("In testServiceLockWaitTimeoutRetryCantRecoverWaiter updating SVCLWTRTCR", module); // TRY grab entity SVCLWTRTCR by looking up and changing, should get a lock wait timeout exception because of the Grabber thread - GenericValue testingType = delegator.findByPrimaryKey("TestingType", "testingTypeId", "SVCLWTRTCR"); + GenericValue testingType = delegator.findOne("TestingType", false, "testingTypeId", "SVCLWTRTCR"); testingType.set("description", "New description for SVCLWTRTCR from Lock Wait Timeout Lock Waiter, this is the value that should be there."); testingType.store(); @@ -307,7 +307,7 @@ LocalDispatcher dispatcher = dctx.getDispatcher(); try { // change the SVC_SRBO value first to test that the rollback really does revert/reset - GenericValue testingType = delegator.findByPrimaryKey("TestingType", "testingTypeId", "SVC_SRBO"); + GenericValue testingType = delegator.findOne("TestingType", false, "testingTypeId", "SVC_SRBO"); testingType.set("description", "New description for SVC_SRBO; this should be reset on the rollback, if this is in the db then the test failed"); testingType.store(); @@ -351,7 +351,7 @@ GenericDelegator delegator = dctx.getDelegator(); try { - GenericValue testingType = delegator.findByPrimaryKey("TestingType", "testingTypeId", "SVC_SECAGC"); + GenericValue testingType = delegator.findOne("TestingType", false, "testingTypeId", "SVC_SECAGC"); testingType.set("description", "New description for SVC_SECAGC, what it should be after the global-commit test"); testingType.store(); } catch (GenericEntityException e) { @@ -370,7 +370,7 @@ GenericDelegator delegator = dctx.getDelegator(); try { - GenericValue testingType = delegator.findByPrimaryKey("TestingType", "testingTypeId", "SVC_SECAGR"); + GenericValue testingType = delegator.findOne("TestingType", false, "testingTypeId", "SVC_SECAGR"); testingType.set("description", "New description for SVC_SECAGR, what it should be after the global-rollback test"); testingType.store(); } catch (GenericEntityException e) { Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java Sat May 3 02:40:51 2008 @@ -174,7 +174,7 @@ try { beganTransaction = TransactionUtil.begin(); - GenericValue userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userLoginId)); + GenericValue userLogin = delegator.findOne("UserLogin", false, "userLoginId", userLoginId); if (userLogin == null) { Debug.logError("Could not find UserLogin record for setLoggedOut with userLoginId [" + userLoginId + "]", module); } else { @@ -528,7 +528,7 @@ if (autoUserLoginId != null) { Debug.logInfo("Running autoLogin check.", module); try { - GenericValue autoUserLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", autoUserLoginId)); + GenericValue autoUserLogin = delegator.findOne("UserLogin", false, "userLoginId", autoUserLoginId); GenericValue person = null; GenericValue group = null; if (autoUserLogin != null) { @@ -536,8 +536,8 @@ ModelEntity modelUserLogin = autoUserLogin.getModelEntity(); if (modelUserLogin.isField("partyId")) { - person = delegator.findByPrimaryKey("Person", UtilMisc.toMap("partyId", autoUserLogin.getString("partyId"))); - group = delegator.findByPrimaryKey("PartyGroup", UtilMisc.toMap("partyId", autoUserLogin.getString("partyId"))); + person = delegator.findOne("Person", false, "partyId", autoUserLogin.getString("partyId")); + group = delegator.findOne("PartyGroup", false, "partyId", autoUserLogin.getString("partyId")); } } if (person != null) { @@ -623,7 +623,7 @@ //Debug.log("Looking up userLogin from CN: " + userLoginId, module); // CN should match the userLoginId - GenericValue userLogin = delegator.findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", userLoginId)); + GenericValue userLogin = delegator.findOne("UserLogin", false, "userLoginId", userLoginId); if (userLogin != null) { String enabled = userLogin.getString("enabled"); if (enabled == null || "Y".equals(enabled)) { Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/stats/VisitHandler.java Sat May 3 02:40:51 2008 @@ -231,7 +231,7 @@ } } else { try { - visitor = delegator.findByPrimaryKey("Visitor", UtilMisc.toMap("visitorId", cookieVisitorId)); + visitor = delegator.findOne("Visitor", false, "visitorId", cookieVisitorId); if (visitor == null) { // looks like we have an ID that doesn't exist in our database, so we'll create a new one visitor = delegator.makeValue("Visitor"); Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/GenericWebEvent.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/GenericWebEvent.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/GenericWebEvent.java (original) +++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/GenericWebEvent.java Sat May 3 02:40:51 2008 @@ -205,7 +205,7 @@ GenericValue tempEntity = null; try { - tempEntity = delegator.findByPrimaryKey(findByEntity.getPrimaryKey()); + tempEntity = delegator.findOne(findByEntity.getEntityName(), findByEntity.getPrimaryKey(), false); } catch (GenericEntityException e) { String errMsg = UtilProperties.getMessage(GenericWebEvent.err_resource, "genericWebEvent.create_failed_by_check", locale) + ": " + e.toString(); Debug.logWarning(e, errMsg, module); Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/print/FoPrintServerEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/print/FoPrintServerEvents.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/print/FoPrintServerEvents.java (original) +++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/print/FoPrintServerEvents.java Sat May 3 02:40:51 2008 @@ -88,7 +88,7 @@ // run as the system user GenericValue system = null; try { - system = dctx.getDelegator().findByPrimaryKey("UserLogin", UtilMisc.toMap("userLoginId", "system")); + system = dctx.getDelegator().findOne("UserLogin", false, "userLoginId", "system"); } catch (GenericEntityException e) { throw new GeneralException(e.getMessage(), e); } Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java Sat May 3 02:40:51 2008 @@ -1885,11 +1885,7 @@ GenericDelegator delegator = this.modelFormField.modelForm.getDelegator(context); String fieldValue = modelFormField.getEntry(context); try { - if (this.cache) { - value = delegator.findByPrimaryKeyCache(this.entityName, UtilMisc.toMap(fieldKey, fieldValue)); - } else { - value = delegator.findByPrimaryKey(this.entityName, UtilMisc.toMap(fieldKey, fieldValue)); - } + value = delegator.findOne(this.entityName, this.cache, fieldKey, fieldValue); } catch (GenericEntityException e) { String errMsg = "Error getting value from the database for display of field [" + this.modelFormField.getName() + "] on form [" + this.modelFormField.modelForm.getName() + "]: " + e.toString(); Debug.logError(e, errMsg, module); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java Sat May 3 02:40:51 2008 @@ -562,7 +562,7 @@ } try { if (id != null && modelEntity.getPksSize() == 1) { - GenericValue entity = delegator.findByPrimaryKey(entName, UtilMisc.toMap(pkName, id)); + GenericValue entity = delegator.findOne(entName, UtilMisc.toMap(pkName, id), false); if (modelEntity.isField("childBranchCount")) { entity.put("childBranchCount", nodeCount); } Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java (original) +++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java Sat May 3 02:40:51 2008 @@ -187,7 +187,7 @@ new EntityExpr("productId", EntityOperator.EQUALS, productId), new EntityExpr("inventoryItemTypeId", EntityOperator.EQUALS, "NON_SERIAL_INV_ITEM"), new EntityExpr("facilityId", EntityOperator.EQUALS, syncInventoryFacilityId)), EntityOperator.AND); - List invItemAndDetails = delegator.findByCondition("InventoryItemDetailForSum", condition, UtilMisc.toList("quantityOnHandSum"), null); + List invItemAndDetails = delegator.findList("InventoryItemDetailForSum", condition, UtilMisc.toSet("quantityOnHandSum"), null, null, false); Iterator invItemAndDetailIter = invItemAndDetails.iterator(); while (invItemAndDetailIter.hasNext()) { GenericValue inventoryItemDetailForSum = (GenericValue) invItemAndDetailIter.next(); @@ -203,7 +203,7 @@ new EntityExpr("statusId", EntityOperator.EQUALS, statusId), new EntityExpr("inventoryItemTypeId", EntityOperator.EQUALS, "SERIALIZED_INV_ITEM"), new EntityExpr("facilityId", EntityOperator.EQUALS, syncInventoryFacilityId)), EntityOperator.AND); - long invItemQuantCount = delegator.findCountByCondition("InventoryItemStatusForCount", serInvCondition, null); + long invItemQuantCount = delegator.findCountByCondition("InventoryItemStatusForCount", serInvCondition, null, null); quantityOnHandTotal += invItemQuantCount; // check for mismatch in quantity Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java?rev=653029&r1=653028&r2=653029&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java (original) +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Sat May 3 02:40:51 2008 @@ -1172,7 +1172,7 @@ List shoppingLists = null; GenericDelegator delegator = this.session.getDelegator(); try { - shoppingLists = delegator.findAll("ShoppingList"); + shoppingLists = delegator.findList("ShoppingList", null, null, null, null, false); } catch (GenericEntityException e) { Debug.logError(e, module); ServiceUtil.returnError("Error running initLowLevelCode: " + e.getMessage()); |
Free forum by Nabble | Edit this page |