You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by le...@apache.org on 2008/05/11 05:29:05 UTC
svn commit: r655235 - in /ofbiz/trunk:
applications/accounting/src/org/ofbiz/accounting/finaccount/
applications/accounting/src/org/ofbiz/accounting/payment/
applications/accounting/src/org/ofbiz/accounting/tax/
applications/content/src/org/ofbiz/conte...
Author: lektran
Date: Sat May 10 20:29:04 2008
New Revision: 655235
URL: http://svn.apache.org/viewvc?rev=655235&view=rev
Log:
Removed the rest of the calls to deprecated GenericDelegator methods, except for the findListIteratorByCondition which takes a DynamicViewEntity as a parameter not sure what to do about that one.
There's still all the bsh files to check though.
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementWorker.java
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.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/order/OrderListState.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java
ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductUtilServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java
ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/OfbizStore.java
ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonWorkers.java
ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java
ofbiz/trunk/framework/common/src/org/ofbiz/common/login/LoginServices.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericValue.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/ListFinder.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataServices.java
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncContext.java
ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.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/webtools/src/org/ofbiz/webtools/WebToolsServices.java
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelFormField.java
ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java
ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java
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=655235&r1=655234&r2=655235&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 10 20:29:04 2008
@@ -355,7 +355,7 @@
EntityListIterator eli = null;
try {
- eli = delegator.findListIteratorByCondition("FinAccountTrans", condition, null, UtilMisc.toList("-transactionDate"));
+ eli = delegator.find("FinAccountTrans", condition, null, null, UtilMisc.toList("-transactionDate"), null);
GenericValue trans;
while (remainingBalance.compareTo(FinAccountHelper.ZERO) == 1 && (trans = (GenericValue) eli.next()) != 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=655235&r1=655234&r2=655235&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 10 20:29:04 2008
@@ -43,6 +43,7 @@
import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityConditionList;
import org.ofbiz.entity.condition.EntityExpr;
+import org.ofbiz.entity.condition.EntityFieldMap;
import org.ofbiz.entity.condition.EntityJoinOperator;
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.model.ModelEntity;
@@ -1844,10 +1845,13 @@
// and that have resultNsf = Y, ie only consider other NSF responses
Long autoOrderCcTryLaterMax = productStore.getLong("autoOrderCcTryLaterMax");
if (autoOrderCcTryLaterMax != null) {
- long failedTries = delegator.findCountByAnd("PaymentGatewayResponse",
- UtilMisc.toMap("orderPaymentPreferenceId", orderPaymentPreference.get("orderPaymentPreferenceId"),
- "paymentMethodId", orderPaymentPreference.get("paymentMethodId"),
- "resultNsf", "Y"));
+ long failedTries = delegator.findCountByCondition("PaymentGatewayResponse",
+ new EntityFieldMap(UtilMisc.toMap(
+ "orderPaymentPreferenceId", orderPaymentPreference.get("orderPaymentPreferenceId"),
+ "paymentMethodId", orderPaymentPreference.get("paymentMethodId"),
+ "resultNsf", "Y"),
+ EntityOperator.AND),
+ null, null);
if (failedTries < autoOrderCcTryLaterMax.longValue()) {
needsNsfRetry = true;
}
@@ -2449,8 +2453,8 @@
EntityListIterator eli = null;
try {
- eli = delegator.findListIteratorByCondition("OrderPaymentPreference",
- new EntityConditionList(exprs, EntityOperator.AND), null, UtilMisc.toList("orderId"));
+ eli = delegator.find("OrderPaymentPreference",
+ new EntityConditionList(exprs, EntityOperator.AND), null, null, UtilMisc.toList("orderId"), null);
List processList = new ArrayList();
if (eli != null) {
Debug.logInfo("Processing failed order re-auth(s)", module);
@@ -2496,9 +2500,9 @@
EntityListIterator eli = null;
try {
- eli = delegator.findListIteratorByCondition("OrderPaymentPreference",
+ eli = delegator.find("OrderPaymentPreference",
new EntityExpr(new EntityExpr("needsNsfRetry", EntityOperator.EQUALS, "Y"), EntityOperator.AND, new EntityExpr(ModelEntity.STAMP_FIELD, EntityOperator.LESS_THAN_EQUAL_TO, oneWeekAgo)),
- null, UtilMisc.toList("orderId"));
+ null, null, UtilMisc.toList("orderId"), null);
List processList = new ArrayList();
if (eli != null) {
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=655235&r1=655234&r2=655235&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 10 20:29:04 2008
@@ -88,7 +88,7 @@
if ("Y".equals(productStore.getString("showPricesWithVatTax"))) {
Set taxAuthoritySet = FastSet.newInstance();
if (productStore.get("vatTaxAuthPartyId") == null) {
- List taxAuthorityRawList = delegator.findByConditionCache("TaxAuthority", new EntityExpr("taxAuthGeoId", EntityOperator.EQUALS, productStore.get("vatTaxAuthGeoId")), null, null);
+ List taxAuthorityRawList = delegator.findList("TaxAuthority", new EntityExpr("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")));
@@ -225,7 +225,7 @@
geoIdSet = GeoWorker.expandGeoRegionDeep(geoIdSet, delegator);
//Debug.logInfo("Tax calc geoIdSet after expand:" + geoIdSet, module);
- List taxAuthorityRawList = delegator.findByConditionCache("TaxAuthority", new EntityExpr("taxAuthGeoId", EntityOperator.IN, geoIdSet), null, null);
+ List taxAuthorityRawList = delegator.findList("TaxAuthority", new EntityExpr("taxAuthGeoId", EntityOperator.IN, geoIdSet), null, null, null, true);
taxAuthoritySet.addAll(taxAuthorityRawList);
//Debug.logInfo("Tax calc taxAuthoritySet after expand:" + taxAuthoritySet, module);
}
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=655235&r1=655234&r2=655235&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 10 20:29:04 2008
@@ -754,7 +754,7 @@
} else {
conditionMain = new EntityExpr("contentIdTo", EntityOperator.EQUALS, contentId);
}
- List listAll = delegator.findByConditionCache("ContentAssoc", conditionMain, null, null);
+ List listAll = delegator.findList("ContentAssoc", conditionMain, null, null, null, true);
List listFiltered = EntityUtil.filterByDate(listAll);
Iterator iter = listFiltered.iterator();
while (iter.hasNext()) {
@@ -787,7 +787,7 @@
EntityCondition conditionType = new EntityConditionList(condList, EntityOperator.OR);
EntityCondition conditionMain = new EntityConditionList(UtilMisc.toList( new EntityExpr("contentId", EntityOperator.EQUALS, contentId), conditionType), EntityOperator.AND);
- List listAll = delegator.findByConditionCache("ContentAssoc", conditionMain, null, null);
+ List listAll = delegator.findList("ContentAssoc", conditionMain, null, null, null, true);
List listFiltered = EntityUtil.filterByDate(listAll);
Iterator iter = listFiltered.iterator();
while (iter.hasNext()) {
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java Sat May 10 20:29:04 2008
@@ -292,11 +292,7 @@
}
List assocs;
- if (cache) {
- assocs = delegator.findByConditionCache("ContentAssoc", new EntityConditionList(exprs, EntityOperator.AND), null, orderBy);
- } else {
- assocs = delegator.findList("ContentAssoc", new EntityConditionList(exprs, EntityOperator.AND), null, orderBy, null, false);
- }
+ assocs = delegator.findList("ContentAssoc", new EntityConditionList(exprs, EntityOperator.AND), null, orderBy, null, cache);
assocs = EntityUtil.filterByDate(assocs);
GenericValue subContent = EntityUtil.getFirst(assocs);
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=655235&r1=655234&r2=655235&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 10 20:29:04 2008
@@ -341,7 +341,7 @@
public long getNumberResponses() throws SurveyWrapperException {
long responses = 0;
try {
- responses = delegator.findCountByAnd("SurveyResponse", UtilMisc.toMap("surveyId", surveyId));
+ responses = delegator.findCountByCondition("SurveyResponse", new EntityExpr("surveyId", EntityOperator.EQUALS, surveyId), null, null);
} catch (GenericEntityException e) {
throw new SurveyWrapperException(e);
}
@@ -733,7 +733,7 @@
efo.setDistinct(false);
EntityListIterator eli = null;
- eli = delegator.findListIteratorByCondition("SurveyResponseAndAnswer", makeEliCondition(question), null, null, null, efo);
+ eli = delegator.find("SurveyResponseAndAnswer", makeEliCondition(question), null, null, null, efo);
return eli;
}
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=655235&r1=655234&r2=655235&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 10 20:29:04 2008
@@ -41,6 +41,7 @@
import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityConditionList;
import org.ofbiz.entity.condition.EntityExpr;
+import org.ofbiz.entity.condition.EntityFieldMap;
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.util.EntityUtil;
import org.ofbiz.manufacturing.bom.BOMNode;
@@ -412,7 +413,8 @@
minimumStock = new Double(0);
}
try {
- long numOfEvents = delegator.findCountByAnd("MrpEvent", UtilMisc.toMap("mrpId", mrpId, "productId", productId));
+ EntityFieldMap ecl = new EntityFieldMap(UtilMisc.toMap("mrpId", mrpId, "productId", productId), EntityOperator.AND);
+ long numOfEvents = delegator.findCountByCondition("MrpEvent", ecl, null, null);
if (numOfEvents > 0) {
continue;
}
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderListState.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderListState.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderListState.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderListState.java Sat May 10 20:29:04 2008
@@ -238,7 +238,7 @@
EntityCondition queryConditionsList = new EntityConditionList(allConditions, EntityOperator.AND);
EntityFindOptions options = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true);
- EntityListIterator iterator = delegator.findListIteratorByCondition("OrderHeader", queryConditionsList, null, null, UtilMisc.toList("orderDate DESC"), options);
+ EntityListIterator iterator = delegator.find("OrderHeader", queryConditionsList, null, null, UtilMisc.toList("orderDate DESC"), options);
// get subset corresponding to pagination state
List orders = iterator.getPartialList(viewSize * viewIndex, viewSize);
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Sat May 10 20:29:04 2008
@@ -1098,7 +1098,7 @@
conditions.add(new EntityExpr("paymentMethodTypeId", EntityOperator.EQUALS, paymentMethodTypeId));
}
EntityConditionList ecl = new EntityConditionList(conditions, EntityOperator.AND);
- List payments = orderHeader.getDelegator().findByConditionCache("PaymentAndApplication", ecl, null, null);
+ List payments = orderHeader.getDelegator().findList("PaymentAndApplication", ecl, null, null, null, true);
for (Iterator iter = payments.iterator(); iter.hasNext(); ) {
GenericValue payment = (GenericValue) iter.next();
@@ -2742,7 +2742,7 @@
GenericValue orderAdjustment = (GenericValue) orderAdjIterator.next();
long count = 0;
try {
- count = orderHeader.getDelegator().findCountByAnd("ReturnAdjustment", UtilMisc.toMap("orderAdjustmentId", orderAdjustment.get("orderAdjustmentId")));
+ count = orderHeader.getDelegator().findCountByCondition("ReturnAdjustment", new EntityExpr("orderAdjustmentId", EntityOperator.EQUALS, orderAdjustment.get("orderAdjustmentId")), null, null);
} catch (GenericEntityException e) {
Debug.logError(e, module);
}
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Sat May 10 20:29:04 2008
@@ -411,7 +411,7 @@
*/
List orderItemQuantitiesIssued = null;
try {
- orderItemQuantitiesIssued = delegator.findByCondition("OrderItemQuantityReportGroupByItem", whereConditions, null, UtilMisc.toList("orderId", "orderItemSeqId", "quantityIssued"), UtilMisc.toList("orderItemSeqId"), null);
+ orderItemQuantitiesIssued = delegator.findList("OrderItemQuantityReportGroupByItem", whereConditions, UtilMisc.toSet("orderId", "orderItemSeqId", "quantityIssued"), UtilMisc.toList("orderItemSeqId"), null, false);
} catch (GenericEntityException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderErrorUnableToGetReturnHeaderFromItem", locale));
@@ -1001,7 +1001,7 @@
EntityConditionList pmtConditionList = new EntityConditionList(UtilMisc.toList(new EntityExpr("paymentMethodTypeId", EntityOperator.NOT_IN, orderedRefundPaymentMethodTypes)), EntityOperator.AND);
List otherPaymentMethodTypes = new ArrayList();
try {
- otherPaymentMethodTypes = delegator.findByConditionCache("PaymentMethodType",pmtConditionList,null,null);
+ otherPaymentMethodTypes = delegator.findList("PaymentMethodType", pmtConditionList, null, null, null, true);
} catch(GenericEntityException e) {
Debug.logError(e, "Cannot get PaymentMethodTypes", module);
return ServiceUtil.returnError("Problems getting PaymentMethodTypes: " + e.toString());
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Sat May 10 20:29:04 2008
@@ -1299,11 +1299,11 @@
new EntityExpr("remainingSubTotal", EntityOperator.EQUALS, null));
cond = new EntityConditionList(exprs, EntityOperator.OR);
}
- List fields = UtilMisc.toList("orderId");
+ Set fields = UtilMisc.toSet("orderId");
EntityListIterator eli = null;
try {
- eli = delegator.findListIteratorByCondition("OrderHeader", cond, fields, null);
+ eli = delegator.find("OrderHeader", cond, null, fields, null, null);
} catch (GenericEntityException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java Sat May 10 20:29:04 2008
@@ -35,6 +35,7 @@
import org.ofbiz.entity.GenericDelegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.condition.EntityConditionList;
import org.ofbiz.entity.condition.EntityExpr;
import org.ofbiz.entity.condition.EntityFieldValue;
import org.ofbiz.entity.condition.EntityFunction;
@@ -1187,7 +1188,8 @@
List blacklistFound = null;
if (exprs.size() > 0) {
try {
- blacklistFound = this.delegator.findByOr("OrderBlacklist", exprs);
+ EntityConditionList ecl = new EntityConditionList(exprs, EntityOperator.AND);
+ blacklistFound = this.delegator.findList("OrderBlacklist", ecl, null, null, null, false);
} catch (GenericEntityException e) {
Debug.logError(e, "Problems with OrderBlacklist lookup.", module);
errMsg = UtilProperties.getMessage(resource,"checkhelper.problems_reading_database", (cart != null ? cart.getLocale() : Locale.getDefault()));
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java Sat May 10 20:29:04 2008
@@ -132,7 +132,7 @@
List order = UtilMisc.toList("-lastOrderedDate");
EntityListIterator eli = null;
- eli = delegator.findListIteratorByCondition("ShoppingList", cond, null, order);
+ eli = delegator.find("ShoppingList", cond, null, null, order, null);
if (eli != null) {
GenericValue shoppingList;
Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java Sat May 10 20:29:04 2008
@@ -25,6 +25,7 @@
import org.ofbiz.entity.GenericDelegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityConditionList;
import org.ofbiz.entity.condition.EntityExpr;
import org.ofbiz.entity.condition.EntityOperator;
@@ -178,17 +179,17 @@
// Find a list of distinct email addresses from active, ACCEPTED parties in the contact list
// using a list iterator (because there can be a large number)
- List conditionList = UtilMisc.toList(
+ List<EntityCondition> conditionList = UtilMisc.toList(
new EntityExpr("contactListId", EntityOperator.EQUALS, contactList.get("contactListId")),
new EntityExpr("statusId", EntityOperator.EQUALS, "CLPT_ACCEPTED"),
new EntityExpr("preferredContactMechId", EntityOperator.NOT_EQUAL, null),
EntityUtil.getFilterByDateExpr(), EntityUtil.getFilterByDateExpr("contactFromDate", "contactThruDate")
);
- EntityConditionList conditions = new EntityConditionList(conditionList, EntityOperator.AND);
- List fieldsToSelect = UtilMisc.toList("infoString");
+ EntityConditionList<EntityCondition> conditions = new EntityConditionList<EntityCondition>(conditionList, EntityOperator.AND);
+ Set<String> fieldsToSelect = UtilMisc.toSet("infoString");
- List sendToEmails = delegator.findByCondition("ContactListPartyAndContactMech", conditions, null, fieldsToSelect, null,
- new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true));
+ List sendToEmails = delegator.findList("ContactListPartyAndContactMech", conditions, fieldsToSelect, null,
+ new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true), false);
// Send an email to each contact list member
// TODO: Contact lists for emails really should be written as an EntityListIterator for very large lists!
@@ -221,7 +222,7 @@
clpConditionList.add(new EntityExpr("infoString", EntityOperator.EQUALS, emailAddress));
EntityConditionList clpConditions = new EntityConditionList(clpConditionList, EntityOperator.AND);
- List emailCLPaCMs = delegator.findByConditionCache("ContactListPartyAndContactMech", clpConditions, null, orderBy);
+ List emailCLPaCMs = delegator.findList("ContactListPartyAndContactMech", clpConditions, null, orderBy, null, true);
GenericValue lastContactListPartyACM = EntityUtil.getFirst(emailCLPaCMs);
if (lastContactListPartyACM == null) continue;
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java Sat May 10 20:29:04 2008
@@ -291,7 +291,7 @@
// set distinct on
EntityFindOptions findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true);
// using list iterator
- EntityListIterator pli = delegator.findListIteratorByCondition(entityName, mainCond, null, null, orderByFields, findOpts);
+ EntityListIterator pli = delegator.find(entityName, mainCond, null, null, orderByFields, findOpts);
// get the partial list for this page
if (limitView) {
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/feature/ParametricSearch.java Sat May 10 20:29:04 2008
@@ -136,7 +136,7 @@
Map productFeaturesByTypeMap = FastMap.newInstance();
try {
Set typesWithOverflowMessages = new HashSet();
- EntityListIterator productFeatureEli = delegator.findListIteratorByCondition("ProductFeature", null, null, UtilMisc.toList("description"));
+ EntityListIterator productFeatureEli = delegator.find("ProductFeature", null, null, null, UtilMisc.toList("description"), null);
GenericValue productFeature = null;
while ((productFeature = (GenericValue) productFeatureEli.next()) != null) {
String productFeatureTypeId = productFeature.getString("productFeatureTypeId");
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/price/PriceServices.java Sat May 10 20:29:04 2008
@@ -221,7 +221,7 @@
// for prices, get all ProductPrice entities for this productId and currencyUomId
List productPrices = null;
try {
- productPrices = delegator.findByConditionCache("ProductPrice", productPriceEc, null, UtilMisc.toList("-fromDate"));
+ productPrices = delegator.findList("ProductPrice", productPriceEc, null, UtilMisc.toList("-fromDate"), null, true);
} catch (GenericEntityException e) {
Debug.logError(e, "An error occurred while getting the product prices", module);
}
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java Sat May 10 20:29:04 2008
@@ -891,7 +891,7 @@
EntityFindOptions findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true);
EntityListIterator pli = null;
try {
- pli = delegator.findListIteratorByCondition("ProductCategoryMember", new EntityConditionList(addOnTopProdCondList, EntityOperator.AND), null, UtilMisc.toList("productId", "sequenceNum"), UtilMisc.toList("sequenceNum"), findOpts);
+ pli = delegator.find("ProductCategoryMember", new EntityConditionList(addOnTopProdCondList, EntityOperator.AND), null, UtilMisc.toSet("productId", "sequenceNum"), UtilMisc.toList("sequenceNum"), findOpts);
addOnTopProductCategoryMembers = pli.getPartialList(lowIndex, viewSize);
addOnTopListSize = addOnTopProductCategoryMembers.size();
for (int i = 0; i < addOnTopProductCategoryMembers.size(); i++) {
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=655235&r1=655234&r2=655235&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 10 20:29:04 2008
@@ -41,6 +41,7 @@
import org.ofbiz.entity.condition.EntityCondition;
import org.ofbiz.entity.condition.EntityConditionList;
import org.ofbiz.entity.condition.EntityExpr;
+import org.ofbiz.entity.condition.EntityFieldMap;
import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.model.DynamicViewEntity;
import org.ofbiz.entity.model.ModelEntity;
@@ -73,7 +74,7 @@
new EntityExpr("salesDiscontinuationDate", EntityOperator.NOT_EQUAL, null),
new EntityExpr("salesDiscontinuationDate", EntityOperator.LESS_THAN_EQUAL_TO, nowTimestamp)
), EntityOperator.AND);
- EntityListIterator eliOne = delegator.findListIteratorByCondition("Product", conditionOne, null, null);
+ EntityListIterator eliOne = delegator.find("Product", conditionOne, null, null, null, null);
GenericValue productOne = null;
int numSoFarOne = 0;
while ((productOne = (GenericValue) eliOne.next()) != null) {
@@ -105,7 +106,7 @@
new EntityExpr("isVirtual", EntityOperator.EQUALS, "Y"),
new EntityExpr(new EntityExpr("salesDiscontinuationDate", EntityOperator.EQUALS, null), EntityOperator.OR, new EntityExpr("salesDiscontinuationDate", EntityOperator.GREATER_THAN_EQUAL_TO, nowTimestamp))
), EntityOperator.AND);
- EntityListIterator eli = delegator.findListIteratorByCondition("Product", condition, null, null);
+ EntityListIterator eli = delegator.find("Product", condition, null, null, null, null);
GenericValue product = null;
int numSoFar = 0;
while ((product = (GenericValue) eli.next()) != null) {
@@ -143,7 +144,7 @@
new EntityExpr("salesDiscontinuationDate", EntityOperator.NOT_EQUAL, null),
new EntityExpr("salesDiscontinuationDate", EntityOperator.LESS_THAN_EQUAL_TO, nowTimestamp)
), EntityOperator.AND);
- EntityListIterator eli = delegator.findListIteratorByCondition("Product", condition, null, null);
+ EntityListIterator eli = delegator.find("Product", condition, null, null, null, null);
GenericValue product = null;
int numSoFar = 0;
while ((product = (GenericValue) eli.next()) != null) {
@@ -477,7 +478,7 @@
newRelatedValue.set("fromDate", nowTimestamp);
}
- if (delegator.findCountByAnd(relatedEntityName, newRelatedValue.getPrimaryKey()) == 0) {
+ if (delegator.findCountByCondition(relatedEntityName, new EntityFieldMap(newRelatedValue.getPrimaryKey(), EntityOperator.AND), null, null) == 0) {
if (test) {
Debug.logInfo("Test mode, would create: " + newRelatedValue, module);
} else {
@@ -512,7 +513,7 @@
}
try {
- EntityListIterator eli = delegator.findListIteratorByCondition("Product", null, null, null);
+ EntityListIterator eli = delegator.find("Product", null, null, null, null, null);
GenericValue product = null;
int numSoFar = 0;
while ((product = (GenericValue) eli.next()) != null) {
@@ -568,7 +569,7 @@
String errMsg = null;
try {
- EntityListIterator eli = delegator.findListIteratorByCondition("Product", new EntityExpr("isVirtual", EntityOperator.EQUALS, "Y"), null, null);
+ EntityListIterator eli = delegator.find("Product", new EntityExpr("isVirtual", EntityOperator.EQUALS, "Y"), null, null, null, null);
GenericValue product = null;
int numSoFar = 0;
while ((product = (GenericValue) eli.next()) != null) {
@@ -686,7 +687,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);
- EntityListIterator productFeatureAndApplEli = delegator.findListIteratorByCondition("ProductFeatureAndAppl", condition, null, null);
+ EntityListIterator productFeatureAndApplEli = delegator.find("ProductFeatureAndAppl", condition, null, null, null, null);
GenericValue productFeatureAndAppl = null;
while ((productFeatureAndAppl = (GenericValue) productFeatureAndApplEli.next()) != null) {
String productFeatureId = productFeatureAndAppl.getString("productFeatureId");
@@ -758,7 +759,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);
- EntityListIterator productFeatureCatGrpApplEli = delegator.findListIteratorByCondition("ProductFeatureCatGrpAppl", condition, null, null);
+ EntityListIterator productFeatureCatGrpApplEli = delegator.find("ProductFeatureCatGrpAppl", condition, null, null, null, null);
GenericValue productFeatureCatGrpAppl = null;
while ((productFeatureCatGrpAppl = (GenericValue) productFeatureCatGrpApplEli.next()) != null) {
String productFeatureGroupId = productFeatureCatGrpAppl.getString("productFeatureGroupId");
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/promo/PromoServices.java Sat May 10 20:29:04 2008
@@ -92,7 +92,7 @@
EntityCondition cond = new EntityConditionList(condList, EntityOperator.AND);
try {
- EntityListIterator eli = delegator.findListIteratorByCondition("ProductStorePromoAndAppl", cond, null, null);
+ EntityListIterator eli = delegator.find("ProductStorePromoAndAppl", cond, null, null, null, null);
GenericValue productStorePromoAndAppl = null;
while ((productStorePromoAndAppl = (GenericValue) eli.next()) != null) {
GenericValue productStorePromo = delegator.makeValue("ProductStorePromoAppl");
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java Sat May 10 20:29:04 2008
@@ -666,7 +666,7 @@
EntityListIterator eli = null;
try {
- eli = delegator.findListIteratorByCondition("OdbcPackageIn", null, null, orderBy);
+ eli = delegator.find("OdbcPackageIn", null, null, null, orderBy, null);
GenericValue pkgInfo;
while ((pkgInfo = (GenericValue) eli.next()) != null) {
String packageSeqId = pkgInfo.getString("shipmentPackageSeqId");
Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java (original)
+++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortSearch.java Sat May 10 20:29:04 2008
@@ -123,8 +123,8 @@
}
// Find WorkEffort where current workEffortId = workEffortParentId; only select minimal fields to keep the size low
- List childWorkEffortList = delegator.findByConditionCache("WorkEffort", new EntityExpr("workEffortParentId", EntityComparisonOperator.EQUALS, workEffortId),
- UtilMisc.toList("workEffortId", "workEffortParentId"), null);
+ List childWorkEffortList = delegator.findList("WorkEffort", new EntityExpr("workEffortParentId", EntityComparisonOperator.EQUALS, workEffortId),
+ UtilMisc.toSet("workEffortId", "workEffortParentId"), null, null, true);
Iterator childWorkEffortIter = childWorkEffortList.iterator();
while (childWorkEffortIter.hasNext()) {
GenericValue childWorkEffort = (GenericValue) childWorkEffortIter.next();
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=655235&r1=655234&r2=655235&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 10 20:29:04 2008
@@ -67,7 +67,7 @@
public int getSize() throws IOException {
long count = 0;
try {
- count = delegator.findCountByAnd(entityName);
+ count = delegator.findCountByCondition(entityName, null, null, null);
} catch (GenericEntityException e) {
throw new IOException(e.getMessage());
}
Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java (original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java Sat May 10 20:29:04 2008
@@ -482,7 +482,7 @@
long count = -1;
try {
- count = delegator.findCountByAnd("SequenceValueItem");
+ count = delegator.findCountByCondition("SequenceValueItem", null, null, null);
} catch (GenericEntityException e) {
Debug.logError(e.getMessage(), module);
return ServiceUtil.returnError("Unable to connect to datasource!");
Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonWorkers.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonWorkers.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonWorkers.java (original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonWorkers.java Sat May 10 20:29:04 2008
@@ -73,7 +73,7 @@
new EntityExpr("geoTypeId", EntityOperator.EQUALS, "TERRITORY")), EntityOperator.OR);
List sortList = UtilMisc.toList("geoName");
try {
- geoList = delegator.findByConditionCache("Geo", condition, null, sortList);
+ geoList = delegator.findList("Geo", condition, null, sortList, null, true);
} catch (GenericEntityException e) {
Debug.logError(e, "Cannot lookup State Geos: " + e.toString(), module);
}
@@ -96,11 +96,11 @@
new EntityExpr("geoTypeId", EntityOperator.EQUALS, "PROVINCE")
), EntityOperator.OR)
), EntityOperator.AND);
- List sortList = UtilMisc.toList("geoId");
+ List<String> sortList = UtilMisc.toList("geoId");
List geoList = FastList.newInstance();
try {
- geoList = delegator.findByConditionCache("GeoAssocAndGeoTo", stateProvinceFindCond, null, sortList);
+ geoList = delegator.findList("GeoAssocAndGeoTo", stateProvinceFindCond, null, sortList, null, true);
} catch (GenericEntityException e) {
Debug.logError(e, "Cannot lookup Geo", module);
}
Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java (original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java Sat May 10 20:29:04 2008
@@ -530,8 +530,8 @@
EntityListIterator listIt = null;
try {
if (noConditionFind || (entityConditionList != null && entityConditionList.getConditionListSize() > 0)) {
- listIt = delegator.findListIteratorByCondition(entityName, entityConditionList,
- null, null, orderByList, new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, false));
+ listIt = delegator.find(entityName, entityConditionList, null, null, orderByList,
+ new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, false));
}
} catch (GenericEntityException e) {
return ServiceUtil.returnError("Error running Find on the [" + entityName + "] entity: " + e.getMessage());
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=655235&r1=655234&r2=655235&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 10 20:29:04 2008
@@ -377,7 +377,7 @@
efo.setResultSetType(EntityFindOptions.TYPE_SCROLL_INSENSITIVE);
exprs.add(new EntityExpr("userLoginId", EntityOperator.EQUALS, userLoginId));
List orderBy = UtilMisc.toList("-fromDate");
- EntityListIterator eli = delegator.findListIteratorByCondition("UserLoginPasswordHistory", new EntityConditionList(exprs, EntityOperator.AND),null, null, orderBy,efo);
+ EntityListIterator eli = delegator.find("UserLoginPasswordHistory", new EntityConditionList(exprs, EntityOperator.AND), null, null, orderBy, efo);
Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
GenericValue pwdHist;
if((pwdHist = (GenericValue) eli.next()) !=null){
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Sat May 10 20:29:04 2008
@@ -1894,18 +1894,20 @@
*@deprecated Use findList() instead
*/
public List<GenericValue> findByOr(String entityName, Object... fields) throws GenericEntityException {
- return this.findByOr(entityName, UtilMisc.<String, Object>toMap(fields));
+ EntityCondition ecl = new EntityFieldMap(UtilMisc.<String, Object>toMap(fields), EntityOperator.OR);
+ return this.findList(entityName, ecl, null, null, null, false);
}
/** Finds Generic Entity records by all of the specified fields (ie: combined using OR)
- * NOTE 20080502: 1 references
+ * NOTE 20080502: 1 references; all changed to findList
* @param entityName The Name of the Entity as defined in the entity XML file
* @param fields The fields of the named entity to query by with their corresponging values
* @return List of GenericValue instances that match the query
*@deprecated Use findList() instead
*/
public List<GenericValue> findByOr(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException {
- return this.findByOr(entityName, fields, null);
+ EntityCondition ecl = new EntityFieldMap(fields, EntityOperator.OR);
+ return this.findList(entityName, ecl, null, null, null, false);
}
/** Finds Generic Entity records by all of the specified fields (ie: combined using AND)
@@ -1922,7 +1924,7 @@
}
/** Finds Generic Entity records by all of the specified fields (ie: combined using OR)
- * NOTE 20080502: 1 references
+ * NOTE 20080502: 1 references; all changed to findList
* @param entityName The Name of the Entity as defined in the entity XML file
* @param fields The fields of the named entity to query by with their corresponging values
* @param orderBy The fields of the named entity to order the query by;
@@ -2012,11 +2014,11 @@
*@deprecated Use findList() instead
*/
public <T extends EntityCondition> List<GenericValue> findByOr(String entityName, T... expressions) throws GenericEntityException {
- return this.findByOr(entityName, Arrays.asList(expressions));
+ return this.findList(entityName, new EntityConditionList<T>(Arrays.asList(expressions), EntityOperator.AND), null, null, null, false);
}
/** Finds Generic Entity records by all of the specified expressions (ie: combined using OR)
- * NOTE 20080502: 2 references
+ * NOTE 20080502: 2 references; all changed to findList
*@param entityName The Name of the Entity as defined in the entity XML file
*@param expressions The expressions to use for the lookup, each consisting of at least a field name, an EntityOperator, and a value to compare to
*@return List of GenericValue instances that match the query
@@ -2045,19 +2047,34 @@
*@deprecated Use findList() instead
*/
public List<GenericValue> findByLike(String entityName, Object... fields) throws GenericEntityException {
- return this.findByLike(entityName, UtilMisc.<String, Object>toMap(fields));
+ Map<String, ? extends Object> fieldMap = UtilMisc.<String, Object>toMap(fields);
+ List<EntityExpr> likeExpressions = FastList.newInstance();
+ if (fieldMap != null) {
+ for (Map.Entry<String, ? extends Object> fieldEntry: fieldMap.entrySet()) {
+ likeExpressions.add(new EntityExpr(fieldEntry.getKey(), EntityOperator.LIKE, fieldEntry.getValue()));
+ }
+ }
+ EntityConditionList<EntityExpr> ecl = new EntityConditionList<EntityExpr>(likeExpressions, EntityOperator.AND);
+ return this.findList(entityName, ecl, null, null, null, false);
}
/**
- * NOTE 20080502: 1 references
+ * NOTE 20080502: 1 references; all changed to findList
*@deprecated Use findList() instead
*/
public List<GenericValue> findByLike(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException {
- return this.findByLike(entityName, fields, null);
+ List<EntityExpr> likeExpressions = FastList.newInstance();
+ if (fields != null) {
+ for (Map.Entry<String, ? extends Object> fieldEntry: fields.entrySet()) {
+ likeExpressions.add(new EntityExpr(fieldEntry.getKey(), EntityOperator.LIKE, fieldEntry.getValue()));
+ }
+ }
+ EntityConditionList<EntityExpr> ecl = new EntityConditionList<EntityExpr>(likeExpressions, EntityOperator.AND);
+ return this.findList(entityName, ecl, null, null, null, false);
}
/**
- * NOTE 20080502: 1 references
+ * NOTE 20080502: 1 references; all changed to findList
*@deprecated Use findList() instead
*/
public List<GenericValue> findByLike(String entityName, Map<String, ? extends Object> fields, List<String> orderBy) throws GenericEntityException {
@@ -2072,7 +2089,7 @@
}
/** Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.
- * NOTE 20080502: 64 references
+ * NOTE 20080502: 64 references; all changed to findList
*@param entityName The Name of the Entity as defined in the entity model XML file
*@param entityCondition The EntityCondition object that specifies how to constrain this query
*@param fieldsToSelect The fields of the named entity to get from the database; if empty or null all fields will be retreived
@@ -2081,11 +2098,11 @@
*@deprecated Use findList() instead
*/
public List<GenericValue> findByCondition(String entityName, EntityCondition entityCondition, Collection<String> fieldsToSelect, List<String> orderBy) throws GenericEntityException {
- return this.findByCondition(entityName, entityCondition, null, fieldsToSelect, orderBy, null);
+ return this.findList(entityName, entityCondition, UtilMisc.toSet(fieldsToSelect), orderBy, null, false);
}
/** Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.
- * NOTE 20080502: 6 references
+ * NOTE 20080502: 6 references; all changed to findList
*@param entityName The name of the Entity as defined in the entity XML file
*@param whereEntityCondition The EntityCondition object that specifies how to constrain this query before any groupings are done (if this is a view entity with group-by aliases)
*@param havingEntityCondition The EntityCondition object that specifies how to constrain this query after any groupings are done (if this is a view entity with group-by aliases)
@@ -2104,7 +2121,7 @@
beganTransaction = TransactionUtil.begin();
}
- EntityListIterator eli = this.findListIteratorByCondition(entityName, whereEntityCondition, havingEntityCondition, fieldsToSelect, orderBy, findOptions);
+ EntityListIterator eli = this.find(entityName, whereEntityCondition, havingEntityCondition, UtilMisc.toSet(fieldsToSelect), orderBy, findOptions);
eli.setDelegator(this);
List<GenericValue> list = eli.getCompleteList();
eli.close();
@@ -2128,7 +2145,7 @@
}
/** Finds GenericValues by the conditions specified in the EntityCondition object, looking first in the cache, see the EntityCondition javadoc for more details.
- * NOTE 20080502: 17 references
+ * NOTE 20080502: 17 references; all changed to findList
*@param entityName The Name of the Entity as defined in the entity model XML file
*@param entityCondition The EntityCondition object that specifies how to constrain this query
*@param fieldsToSelect The fields of the named entity to get from the database; if empty or null all fields will be retreived
@@ -2141,7 +2158,7 @@
}
/** Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.
- * NOTE 20080502: 26 references
+ * NOTE 20080502: 26 references; all changed to find
*@param entityName The Name of the Entity as defined in the entity model XML file
*@param entityCondition The EntityCondition object that specifies how to constrain this query before any groupings are done (if this is a view entity with group-by aliases)
*@param fieldsToSelect The fields of the named entity to get from the database; if empty or null all fields will be retreived
@@ -2156,7 +2173,7 @@
}
/** Finds GenericValues by the conditions specified in the EntityCondition object, the the EntityCondition javadoc for more details.
- * NOTE 20080502: 12 references
+ * NOTE 20080502: 12 references; all changed to find
*@param entityName The name of the Entity as defined in the entity XML file
*@param whereEntityCondition The EntityCondition object that specifies how to constrain this query before any groupings are done (if this is a view entity with group-by aliases)
*@param havingEntityCondition The EntityCondition object that specifies how to constrain this query after any groupings are done (if this is a view entity with group-by aliases)
@@ -2320,23 +2337,23 @@
}
/**
- * NOTE 20080502: 3 references
+ * NOTE 20080502: 3 references; all changed to findCoundByCondition
*@deprecated Use findCountByCondition() instead
*/
public long findCountByAnd(String entityName) throws GenericEntityException {
- return findCountByAnd(entityName, (Map<String, Object>) null);
+ return findCountByCondition(entityName, null, null, null);
}
/**
- * NOTE 20080502: 1 references
+ * NOTE 20080502: 1 references; all changed to use findCountByCondition
*@deprecated Use findCountByCondition() instead
*/
public long findCountByAnd(String entityName, Object... fields) throws GenericEntityException {
- return findCountByAnd(entityName, UtilMisc.<String, Object>toMap(fields));
+ return findCountByCondition(entityName, new EntityFieldMap(UtilMisc.<String, Object>toMap(fields), EntityOperator.AND), null, null);
}
/**
- * NOTE 20080502: 8 references
+ * NOTE 20080502: 8 references; all changed to use findCountByCondition
*@deprecated Use findCountByCondition() instead
*/
public long findCountByAnd(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException {
@@ -2466,7 +2483,7 @@
}
/** Get the named Related Entity for the GenericValue from the persistent store
- * NOTE 20080502: 1 references
+ * NOTE 20080502: 1 references; all changed to use remaining getRelated
* @param relationName String containing the relation name which is the
* combination of relation.title and relation.rel-entity-name as
* specified in the entity XML definition file
@@ -2479,7 +2496,7 @@
}
/** Get the named Related Entity for the GenericValue from the persistent store
- * NOTE 20080502: 1 references
+ * NOTE 20080502: 1 references; all changed to use getRelated
* @param relationName String containing the relation name which is the
* combination of relation.title and relation.rel-entity-name as
* specified in the entity XML definition file
@@ -2493,7 +2510,7 @@
}
/** Get the named Related Entity for the GenericValue from the persistent store
- * NOTE 20080502: 1 references
+ * NOTE 20080502: 1 references; all changed to use getRelated
* @param relationName String containing the relation name which is the
* combination of relation.title and relation.rel-entity-name as
* specified in the entity XML definition file
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericValue.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericValue.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericValue.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericValue.java Sat May 10 20:29:04 2008
@@ -31,6 +31,8 @@
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.condition.EntityFieldMap;
+import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.model.ModelEntity;
import org.ofbiz.entity.model.ModelKeyMap;
import org.ofbiz.entity.model.ModelRelation;
@@ -161,7 +163,7 @@
*@return List of GenericValue instances as specified in the relation definition
*/
public List<GenericValue> getRelated(String relationName) throws GenericEntityException {
- return this.getDelegator().getRelated(relationName, this);
+ return this.getDelegator().getRelated(relationName, null, null, this);
}
/** Get the named Related Entity for the GenericValue from the persistent store
@@ -342,7 +344,7 @@
*@return List of GenericValue instances as specified in the relation definition
*/
public List<GenericValue> getRelatedByAnd(String relationName, Map<String, ? extends Object> fields) throws GenericEntityException {
- return this.getDelegator().getRelatedByAnd(relationName, fields, this);
+ return this.getDelegator().getRelated(relationName, fields, null, this);
}
/** Get the named Related Entity for the GenericValue from the persistent
@@ -372,7 +374,7 @@
*@return List of GenericValue instances as specified in the relation definition
*/
public List<GenericValue> getRelatedOrderBy(String relationName, List<String> orderBy) throws GenericEntityException {
- return this.getDelegator().getRelatedOrderBy(relationName, orderBy, this);
+ return this.getDelegator().getRelated(relationName, null, orderBy, this);
}
/** Get the named Related Entity for the GenericValue from the persistent
@@ -444,7 +446,8 @@
ModelKeyMap keyMap = relation.getKeyMap(i);
fields.put(keyMap.getRelFieldName(), this.get(keyMap.getFieldName()));
}
- long count = this.getDelegator().findCountByAnd(relation.getRelEntityName(), fields);
+ EntityFieldMap ecl = new EntityFieldMap(fields, EntityOperator.AND);
+ long count = this.getDelegator().findCountByCondition(relation.getRelEntityName(), ecl, null, null);
if (count == 0) {
if (insertDummy) {
// create the new related value (dummy)
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/ListFinder.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/ListFinder.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/ListFinder.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/ListFinder.java Sat May 10 20:29:04 2008
@@ -175,7 +175,7 @@
}
if (useCache) {
- List<GenericValue> results = delegator.findByConditionCache(entityName, whereEntityCondition, fieldsToSelect, orderByFields);
+ List<GenericValue> results = delegator.findList(entityName, whereEntityCondition, fieldsToSelect, orderByFields, null, true);
this.outputHandler.handleOutput(results, context, listAcsr);
} else {
boolean useTransaction = true;
@@ -194,7 +194,7 @@
beganTransaction = TransactionUtil.begin();
}
- EntityListIterator eli = delegator.findListIteratorByCondition(entityName, whereEntityCondition, havingEntityCondition, fieldsToSelect, orderByFields, options);
+ EntityListIterator eli = delegator.find(entityName, whereEntityCondition, havingEntityCondition, fieldsToSelect, orderByFields, options);
this.outputHandler.handleOutput(eli, context, listAcsr);
} catch (GenericEntityException e) {
String errMsg = "Failure in by " + label + " find operation, rolling back transaction";
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=655235&r1=655234&r2=655235&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 10 20:29:04 2008
@@ -56,7 +56,7 @@
// make sure there are some dummy keys
synchronized(EntityCrypto.class) {
try {
- long size = delegator.findCountByAnd("EntityKeyStore");
+ long size = delegator.findCountByCondition("EntityKeyStore", null, null, null);
if (size == 0) {
for (int i = 0; i < 20; i++) {
String randomName = this.getRandomString();
Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataServices.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataServices.java (original)
+++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/data/EntityDataServices.java Sat May 10 20:29:04 2008
@@ -455,7 +455,7 @@
EntityListIterator eli = null;
try {
- eli = delegator.findListIteratorByCondition(entityName, null, null, null);
+ eli = delegator.find(entityName, null, null, null, null, null);
GenericValue currentValue;
while ((currentValue = eli.next()) != null) {
byte[] bytes = currentValue.getBytes(fieldName);
Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java (original)
+++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/permission/EntityPermissionChecker.java Sat May 10 20:29:04 2008
@@ -265,7 +265,7 @@
EntityCondition opCond = new EntityExpr(lcEntityName + "OperationId", EntityOperator.IN, targetOperationList);
- List targetOperationEntityList = delegator.findByConditionCache(modelOperationEntity.getEntityName(), opCond, null, null);
+ List targetOperationEntityList = delegator.findList(modelOperationEntity.getEntityName(), opCond, null, null, null, true);
Map entities = new HashMap();
String pkFieldName = modelEntity.getFirstPkFieldName();
@@ -1066,7 +1066,7 @@
public void init( GenericDelegator delegator) throws GenericEntityException {
EntityCondition opCond = new EntityExpr(operationFieldName, EntityOperator.IN, this.operationList);
- this.entityList = delegator.findByConditionCache(this.entityName, opCond, null, null);
+ this.entityList = delegator.findList(this.entityName, opCond, null, null, null, true);
}
public void restart() {
@@ -1363,7 +1363,7 @@
EntityExpr expr = new EntityExpr(entityIdFieldName, EntityOperator.IN, idList);
EntityExpr expr2 = new EntityExpr(partyIdFieldName, EntityOperator.EQUALS, partyId);
EntityConditionList condList = new EntityConditionList(UtilMisc.toList(expr, expr2), EntityOperator.AND);
- List roleList = delegator.findByConditionCache(entityName, condList, null, null);
+ List roleList = delegator.findList(entityName, condList, null, null, null, true);
List roleListFiltered = EntityUtil.filterByDate(roleList);
HashSet distinctSet = new HashSet();
Iterator iter = roleListFiltered.iterator();
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=655235&r1=655234&r2=655235&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 10 20:29:04 2008
@@ -352,7 +352,7 @@
EntityCondition findValCondition = new EntityConditionList(UtilMisc.toList(
new EntityExpr(ModelEntity.CREATE_STAMP_TX_FIELD, EntityOperator.GREATER_THAN_EQUAL_TO, currentRunStartTime),
new EntityExpr(ModelEntity.CREATE_STAMP_TX_FIELD, EntityOperator.LESS_THAN, currentRunEndTime)), EntityOperator.AND);
- EntityListIterator eli = delegator.findListIteratorByCondition(modelEntity.getEntityName(), findValCondition, null, UtilMisc.toList(ModelEntity.CREATE_STAMP_TX_FIELD, ModelEntity.CREATE_STAMP_FIELD));
+ EntityListIterator eli = delegator.find(modelEntity.getEntityName(), findValCondition, null, null, UtilMisc.toList(ModelEntity.CREATE_STAMP_TX_FIELD, ModelEntity.CREATE_STAMP_FIELD), null);
GenericValue nextValue = null;
long valuesPerEntity = 0;
while ((nextValue = (GenericValue) eli.next()) != null) {
@@ -382,7 +382,7 @@
new EntityExpr(ModelEntity.CREATE_STAMP_TX_FIELD, EntityOperator.NOT_EQUAL, null),
new EntityExpr(ModelEntity.CREATE_STAMP_TX_FIELD, EntityOperator.GREATER_THAN_EQUAL_TO, currentRunEndTime)),
EntityOperator.AND);
- EntityListIterator eliNext = delegator.findListIteratorByCondition(modelEntity.getEntityName(), findNextCondition, null, UtilMisc.toList(ModelEntity.CREATE_STAMP_TX_FIELD));
+ EntityListIterator eliNext = delegator.find(modelEntity.getEntityName(), findNextCondition, null, null, UtilMisc.toList(ModelEntity.CREATE_STAMP_TX_FIELD), null);
// get the first element and it's tx time value...
GenericValue firstVal = (GenericValue) eliNext.next();
eliNext.close();
@@ -495,7 +495,7 @@
new EntityExpr(ModelEntity.STAMP_TX_FIELD, EntityOperator.LESS_THAN, currentRunEndTime),
createdBeforeStartCond),
EntityOperator.AND);
- EntityListIterator eli = delegator.findListIteratorByCondition(modelEntity.getEntityName(), findValCondition, null, UtilMisc.toList(ModelEntity.STAMP_TX_FIELD, ModelEntity.STAMP_FIELD));
+ EntityListIterator eli = delegator.find(modelEntity.getEntityName(), findValCondition, null, null, UtilMisc.toList(ModelEntity.STAMP_TX_FIELD, ModelEntity.STAMP_FIELD), null);
GenericValue nextValue = null;
long valuesPerEntity = 0;
while ((nextValue = (GenericValue) eli.next()) != null) {
@@ -527,7 +527,7 @@
new EntityExpr(ModelEntity.CREATE_STAMP_TX_FIELD, EntityOperator.NOT_EQUAL, null),
new EntityExpr(ModelEntity.CREATE_STAMP_TX_FIELD, EntityOperator.LESS_THAN, currentRunEndTime)),
EntityOperator.AND);
- EntityListIterator eliNext = delegator.findListIteratorByCondition(modelEntity.getEntityName(), findNextCondition, null, UtilMisc.toList(ModelEntity.STAMP_TX_FIELD));
+ EntityListIterator eliNext = delegator.find(modelEntity.getEntityName(), findNextCondition, null, null, UtilMisc.toList(ModelEntity.STAMP_TX_FIELD), null);
// get the first element and it's tx time value...
GenericValue firstVal = (GenericValue) eliNext.next();
eliNext.close();
@@ -618,7 +618,7 @@
EntityCondition findValCondition = new EntityConditionList(UtilMisc.toList(
new EntityExpr(ModelEntity.STAMP_TX_FIELD, EntityOperator.GREATER_THAN_EQUAL_TO, currentRunStartTime),
new EntityExpr(ModelEntity.STAMP_TX_FIELD, EntityOperator.LESS_THAN, currentRunEndTime)), EntityOperator.AND);
- EntityListIterator removeEli = delegator.findListIteratorByCondition("EntitySyncRemove", findValCondition, null, UtilMisc.toList(ModelEntity.STAMP_TX_FIELD, ModelEntity.STAMP_FIELD));
+ EntityListIterator removeEli = delegator.find("EntitySyncRemove", findValCondition, null, null, UtilMisc.toList(ModelEntity.STAMP_TX_FIELD, ModelEntity.STAMP_FIELD), null);
GenericValue entitySyncRemove = null;
while ((entitySyncRemove = (GenericValue) removeEli.next()) != null) {
// pull the PK from the EntitySyncRemove in the primaryKeyRemoved field, de-XML-serialize it
@@ -659,7 +659,7 @@
// if we didn't find anything for this entity, find the next value's Timestamp and keep track of it
if (keysToRemove.size() == 0) {
EntityCondition findNextCondition = new EntityExpr(ModelEntity.STAMP_TX_FIELD, EntityOperator.GREATER_THAN_EQUAL_TO, currentRunEndTime);
- EntityListIterator eliNext = delegator.findListIteratorByCondition("EntitySyncRemove", findNextCondition, null, UtilMisc.toList(ModelEntity.STAMP_TX_FIELD));
+ EntityListIterator eliNext = delegator.find("EntitySyncRemove", findNextCondition, null, null, UtilMisc.toList(ModelEntity.STAMP_TX_FIELD), null);
// get the first element and it's tx time value...
GenericValue firstVal = (GenericValue) eliNext.next();
eliNext.close();
@@ -864,10 +864,10 @@
while (entityModelToUseIter.hasNext()) {
ModelEntity modelEntity = (ModelEntity) entityModelToUseIter.next();
// fields to select will be PK and the STAMP_TX_FIELD, slimmed down so we don't get a ton of data back
- List fieldsToSelect = new LinkedList(modelEntity.getPkFieldNames());
+ Set fieldsToSelect = UtilMisc.toSet(modelEntity.getPkFieldNames());
// find all instances of this entity with the STAMP_TX_FIELD != null, sort ascending to get lowest/oldest value first, then grab first and consider as candidate currentRunStartTime
fieldsToSelect.add(ModelEntity.STAMP_TX_FIELD);
- EntityListIterator eli = delegator.findListIteratorByCondition(modelEntity.getEntityName(), new EntityExpr(ModelEntity.STAMP_TX_FIELD, EntityOperator.NOT_EQUAL, null), fieldsToSelect, UtilMisc.toList(ModelEntity.STAMP_TX_FIELD));
+ EntityListIterator eli = delegator.find(modelEntity.getEntityName(), new EntityExpr(ModelEntity.STAMP_TX_FIELD, EntityOperator.NOT_EQUAL, null), null, fieldsToSelect, UtilMisc.toList(ModelEntity.STAMP_TX_FIELD), null);
GenericValue nextValue = (GenericValue) eli.next();
eli.close();
if (nextValue != null) {
Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java (original)
+++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/entityops/FindByAnd.java Sat May 10 20:29:04 2008
@@ -85,7 +85,7 @@
if (!mapAcsr.isEmpty()) {
whereCond = new EntityFieldMap((Map) mapAcsr.get(methodContext), EntityOperator.AND);
}
- listAcsr.put(methodContext, delegator.findListIteratorByCondition(entityName, whereCond, null, null, orderByNames, null));
+ listAcsr.put(methodContext, delegator.find(entityName, whereCond, null, null, orderByNames, null));
} else {
if (useCache) {
listAcsr.put(methodContext, delegator.findByAndCache(entityName, (Map) mapAcsr.get(methodContext), orderByNames));
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=655235&r1=655234&r2=655235&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 10 20:29:04 2008
@@ -389,7 +389,7 @@
// begin this transaction
beganTx1 = TransactionUtil.begin();
- EntityListIterator foundJobs = delegator.findListIteratorByCondition("JobSandbox", mainCond, null, null, null, findOptions);
+ EntityListIterator foundJobs = delegator.find("JobSandbox", mainCond, null, null, null, findOptions);
curList = foundJobs.getPartialList(1, 1000);
foundJobs.close();
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=655235&r1=655234&r2=655235&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 10 20:29:04 2008
@@ -37,6 +37,8 @@
import org.ofbiz.entity.GenericDelegator;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.condition.EntityFieldMap;
+import org.ofbiz.entity.condition.EntityOperator;
import org.ofbiz.entity.serialize.SerializeException;
import org.ofbiz.entity.serialize.XmlSerializer;
import org.ofbiz.service.DispatchContext;
@@ -290,7 +292,8 @@
long count = 0;
try {
- count = delegator.findCountByAnd("JobSandbox", "parentJobId", pJobId, "statusId", "SERVICE_FAILED");
+ EntityFieldMap ecl = new EntityFieldMap(UtilMisc.toMap("parentJobId", pJobId, "statusId", "SERVICE_FAILED"), EntityOperator.AND);
+ count = delegator.findCountByCondition("JobSandbox", ecl, null, null);
} catch (GenericEntityException e) {
Debug.logError(e, module);
}
Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java (original)
+++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java Sat May 10 20:29:04 2008
@@ -521,7 +521,7 @@
// some databases don't support cursors, or other problems may happen, so if there is an error here log it and move on to get as much as possible
try {
- values = delegator.findListIteratorByCondition(curEntityName, null, null, null, me.getPkFieldNames(), null);
+ values = delegator.find(curEntityName, null, null, null, me.getPkFieldNames(), null);
} catch (Exception entityEx) {
results.add("["+fileNumber +"] [xxx] Error when writing " + curEntityName + ": " + entityEx);
continue;
@@ -991,7 +991,7 @@
}
if (cond != null || "Y".equals(showAll)) {
try {
- eli = delegator.findListIteratorByCondition("JobSandbox", cond, null, null, orderBy, findOpts);
+ eli = delegator.find("JobSandbox", cond, null, null, orderBy, findOpts);
// get the indexes for the partial list
lowIndex = viewIndex * viewSize + 1;
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=655235&r1=655234&r2=655235&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 10 20:29:04 2008
@@ -1688,11 +1688,7 @@
Locale locale = UtilMisc.ensureLocale(context.get("locale"));
List values = null;
- if (this.cache) {
- values = delegator.findByConditionCache(this.entityName, findCondition, null, this.orderByList);
- } else {
- values = delegator.findList(this.entityName, findCondition, null, this.orderByList, null, false);
- }
+ values = delegator.findList(this.entityName, findCondition, null, this.orderByList, null, this.cache);
// filter-by-date if requested
if ("true".equals(this.filterByDate)) {
Modified: ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java (original)
+++ ofbiz/trunk/specialpurpose/ebay/src/org/ofbiz/ebay/ProductsExportToEbay.java Sat May 10 20:29:04 2008
@@ -172,7 +172,7 @@
List selectResult = (List)context.get("selectResult");
// Get the list of products to be exported to eBay
- List productsList = delegator.findByCondition("Product", new EntityExpr("productId", EntityOperator.IN, selectResult), null, null);
+ List productsList = delegator.findList("Product", new EntityExpr("productId", EntityOperator.IN, selectResult), null, null, null, false);
try {
Document itemDocument = UtilXml.makeEmptyXmlDocument("AddItemRequest");
Modified: ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java (original)
+++ ofbiz/trunk/specialpurpose/googlebase/src/org/ofbiz/googlebase/ProductsExportToGoogle.java Sat May 10 20:29:04 2008
@@ -349,7 +349,7 @@
return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToGoogle.invalidCountryCode", locale));
}
// Get the list of products to be exported to Google Base
- List productsList = delegator.findByCondition("Product", new EntityExpr("productId", EntityOperator.IN, selectResult), null, null);
+ List productsList = delegator.findList("Product", new EntityExpr("productId", EntityOperator.IN, selectResult), null, null, null, false);
// Get the tracking code
if (UtilValidate.isEmpty(trackingCodeId) || "_NA_".equals(trackingCodeId)) {
Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java?rev=655235&r1=655234&r2=655235&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java (original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/event/ManagerEvents.java Sat May 10 20:29:04 2008
@@ -480,7 +480,7 @@
EntityListIterator eli = null;
try {
- eli = delegator.findListIteratorByCondition("OrderHeaderAndPaymentPref", new EntityConditionList(exprs, EntityOperator.AND), null, null);
+ eli = delegator.find("OrderHeaderAndPaymentPref", new EntityConditionList(exprs, EntityOperator.AND), null, null, null, null);
} catch (GenericEntityException e) {
Debug.logError(e, module);
}