Modified: 
ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchServices.java?rev=1642398&r1=1642397&r2=1642398&view=diff
==============================================================================
--- 
ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchServices.java
 (original)
+++ 
ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchServices.java
 Sat Nov 29 08:00:37 2014
@@ -31,6 +31,7 @@ import org.ofbiz.base.util.UtilPropertie
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityQuery;
 import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.GenericServiceException;
@@ -72,9 +73,8 @@ public class SearchServices {
         Delegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         try {
-            List<GenericValue> productFeatureAppls = 
delegator.findByAnd("ProductFeatureAppl", UtilMisc.toMap("productFeatureId", 
context.get("productFeatureId")), null, false);
-            // Only re-index the active appls, future dated ones will get 
picked up on that product's re-index date
-            productFeatureAppls = EntityUtil.filterByDate(productFeatureAppls);
+             // Only re-index the active appls, future dated ones will get 
picked up on that product's re-index date
+             List<GenericValue> productFeatureAppls = 
EntityQuery.use(delegator).from("ProductFeatureAppl").where("productFeatureId", 
context.get("productFeatureId")).filterByDate().queryList();
 
             for (GenericValue productFeatureAppl : productFeatureAppls) {
                 try {
@@ -105,7 +105,7 @@ public class SearchServices {
         Delegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         try {
-            List<GenericValue> contents = delegator.findByAnd("Content", 
UtilMisc.toMap("dataResourceId", context.get("dataResourceId")), null, false);
+            List<GenericValue> contents = 
EntityQuery.use(delegator).from("Content").where("dataResourceId", 
context.get("dataResourceId")).queryList();
             for (GenericValue content : contents) {
                 dispatcher.runSync("indexProductsFromContent",
                         UtilMisc.toMap(
@@ -123,7 +123,7 @@ public class SearchServices {
         Delegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         try {
-            List<GenericValue> productContents = 
delegator.findByAnd("ProductContent", UtilMisc.toMap("contentId", 
context.get("contentId")), null, false);
+            List<GenericValue> productContents = 
EntityQuery.use(delegator).from("ProductContent").where("contentId", 
context.get("contentId")).queryList();
             for (GenericValue productContent : productContents) {
                 try {
                     dispatcher.runSync("indexProduct", 
UtilMisc.toMap("productId", productContent.get("productId")));
@@ -149,7 +149,7 @@ public class SearchServices {
         return ServiceUtil.returnSuccess();
     }
     private static void indexProductCategoryRollup(String 
parentProductCategoryId, Delegator delegator, LocalDispatcher dispatcher, 
Set<String> excludeProductCategoryIds) throws GenericEntityException {
-        List<GenericValue> productCategoryRollups = 
delegator.findByAnd("ProductCategoryRollup", 
UtilMisc.toMap("parentProductCategoryId", parentProductCategoryId), null, 
false);
+        List<GenericValue> productCategoryRollups = 
EntityQuery.use(delegator).from("ProductCategoryRollup").where("parentProductCategoryId",
 parentProductCategoryId).queryList();
         for (GenericValue productCategoryRollup : productCategoryRollups) {
             String productCategoryId = 
productCategoryRollup.getString("productCategoryId");
             // Avoid infinite recursion
@@ -162,7 +162,7 @@ public class SearchServices {
     }
 
     private static void indexProductCategoryMembers(String productCategoryId, 
Delegator delegator, LocalDispatcher dispatcher) throws GenericEntityException {
-        List<GenericValue> productCategoryMembers = 
delegator.findByAnd("ProductCategoryMember", 
UtilMisc.toMap("productCategoryId", productCategoryId), null, false);
+        List<GenericValue> productCategoryMembers = 
EntityQuery.use(delegator).from("ProductCategoryMember").where("productCategoryId",
 productCategoryId).queryList();
         for (GenericValue productCategoryMember : productCategoryMembers) {
             try {
                 dispatcher.runSync("indexProduct", UtilMisc.toMap("productId", 
productCategoryMember.get("productId")));

Modified: 
ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java?rev=1642398&r1=1642397&r2=1642398&view=diff
==============================================================================
--- 
ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java
 (original)
+++ 
ofbiz/trunk/specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java
 Sat Nov 29 08:00:37 2014
@@ -31,8 +31,8 @@ import org.ofbiz.content.content.Content
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityQuery;
 import org.ofbiz.service.LocalDispatcher;
-
 import org.apache.lucene.util.Version;
 
 /**
@@ -75,7 +75,7 @@ public class SearchWorker {
         List<GenericValue> contentList = new ArrayList<GenericValue>();
         for (String id : idList) {
             try {
-                GenericValue content = delegator.findOne("Content", UtilMisc 
.toMap("contentId", id), true);
+                GenericValue content = 
EntityQuery.use(delegator).from("Content").where("contentId", 
id).cache(true).queryOne();
                 if (content != null) {
                     contentList.add(content);
                 }

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=1642398&r1=1642397&r2=1642398&view=diff
==============================================================================
--- 
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java
 (original)
+++ 
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisInventoryServices.java
 Sat Nov 29 08:00:37 2014
@@ -182,7 +182,7 @@ public class OagisInventoryServices {
                                 EntityCondition.makeCondition("productId", 
EntityOperator.EQUALS, productId),
                                 
EntityCondition.makeCondition("inventoryItemTypeId", EntityOperator.EQUALS, 
"NON_SERIAL_INV_ITEM"),
                                 EntityCondition.makeCondition("facilityId", 
EntityOperator.EQUALS, syncInventoryFacilityId)), EntityOperator.AND);
-                        List<GenericValue> invItemAndDetails = 
delegator.findList("InventoryItemDetailForSum", condition, 
UtilMisc.toSet("quantityOnHandSum"), null, null, false);
+                        List<GenericValue> invItemAndDetails = 
EntityQuery.use(delegator).select("quantityOnHandSum").from("InventoryItemDetailForSum").where(condition).queryList();
                         for (GenericValue inventoryItemDetailForSum : 
invItemAndDetails) {
                             quantityOnHandTotal += 
inventoryItemDetailForSum.getDouble("quantityOnHandSum").doubleValue();
                         }
@@ -196,7 +196,7 @@ public class OagisInventoryServices {
                             EntityCondition.makeCondition("statusId", 
EntityOperator.EQUALS, statusId),
                             
EntityCondition.makeCondition("inventoryItemTypeId", EntityOperator.EQUALS, 
"SERIALIZED_INV_ITEM"),
                             EntityCondition.makeCondition("facilityId", 
EntityOperator.EQUALS, syncInventoryFacilityId)), EntityOperator.AND);
-                    long invItemQuantCount = 
delegator.findCountByCondition("InventoryItemStatusForCount", serInvCondition, 
null, null);
+                    long invItemQuantCount = 
EntityQuery.use(delegator).from("InventoryItemStatusForCount").where(serInvCondition).queryCount();
                     quantityOnHandTotal += invItemQuantCount;
 
                     // check for mismatch in quantity
@@ -400,7 +400,7 @@ public class OagisInventoryServices {
         // before getting into this check to see if we've tried once and had 
an error, if so set isErrorRetry even if it wasn't passed in
         GenericValue previousOagisMessageInfo = null;
         try {
-            previousOagisMessageInfo = delegator.findOne("OagisMessageInfo", 
omiPkMap, false);
+            previousOagisMessageInfo = 
EntityQuery.use(delegator).from("OagisMessageInfo").where(omiPkMap).queryOne();
         } catch (GenericEntityException e) {
             String errMsg = "Error getting OagisMessageInfo from database for 
message ID [" + omiPkMap + "]: " + e.toString();
             Debug.logInfo(e, errMsg, module);
@@ -700,7 +700,7 @@ public class OagisInventoryServices {
         // before getting into this check to see if we've tried once and had 
an error, if so set isErrorRetry even if it wasn't passed in
         GenericValue previousOagisMessageInfo = null;
         try {
-            previousOagisMessageInfo = delegator.findOne("OagisMessageInfo", 
omiPkMap, false);
+            previousOagisMessageInfo = 
EntityQuery.use(delegator).from("OagisMessageInfo").where(omiPkMap).queryOne();
         } catch (GenericEntityException e) {
             String errMsg = "Error getting OagisMessageInfo from database for 
message ID [" + omiPkMap + "]: " + e.toString();
             Debug.logInfo(e, errMsg, module);
@@ -898,9 +898,8 @@ public class OagisInventoryServices {
                                     Set<String> productIdSet = 
ProductWorker.getRefurbishedProductIdSet(productId, delegator);
                                     productIdSet.add(productId);
 
-                                    EntityCondition bySerialNumberCondition = 
EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber", 
EntityOperator.EQUALS, serialNum),
-                                            EntityOperator.AND, 
EntityCondition.makeCondition("productId", EntityOperator.IN, productIdSet));
-                                    List<GenericValue> 
inventoryItemsBySerialNumber = delegator.findList("InventoryItem", 
bySerialNumberCondition, null, null, null, false);
+                                    List<GenericValue> 
inventoryItemsBySerialNumber = 
EntityQuery.use(delegator).from("InventoryItem").where(EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber",
 EntityOperator.EQUALS, serialNum),
+                                            EntityOperator.AND, 
EntityCondition.makeCondition("productId", EntityOperator.IN, 
productIdSet))).queryList();
 
                                     if (OagisServices.requireSerialNumberExist 
!= null) {
                                         // according to 
requireSerialNumberExist make sure serialNumber does or does not exist in 
database, add an error message as needed
@@ -1354,9 +1353,8 @@ public class OagisInventoryServices {
                             Set<String> productIdSet = 
ProductWorker.getRefurbishedProductIdSet(productId, delegator);
                             productIdSet.add(productId);
 
-                            EntityCondition bySerialNumberCondition = 
EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber", 
EntityOperator.EQUALS, serialNum),
-                                    EntityOperator.AND, 
EntityCondition.makeCondition("productId", EntityOperator.IN, productIdSet));
-                            List<GenericValue> inventoryItemsBySerialNumber = 
delegator.findList("InventoryItem", bySerialNumberCondition, null, null, null, 
false);
+                            List<GenericValue> inventoryItemsBySerialNumber = 
EntityQuery.use(delegator).from("InventoryItem").where(EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber",
 EntityOperator.EQUALS, serialNum),
+                                    EntityOperator.AND, 
EntityCondition.makeCondition("productId", EntityOperator.IN, 
productIdSet))).queryList();
 
                             // this is a status update, so referenced serial 
number MUST already exist
                             if (inventoryItemsBySerialNumber.size() == 0) {

Modified: 
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java?rev=1642398&r1=1642397&r2=1642398&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java 
(original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisServices.java Sat 
Nov 29 08:00:37 2014
@@ -242,7 +242,7 @@ public class OagisServices {
         Locale locale = (Locale) context.get("locale");
         GenericValue userLogin = null;
         try {
-            userLogin = 
delegator.findOne("UserLogin",UtilMisc.toMap("userLoginId", "system"), false);
+            userLogin = 
EntityQuery.use(delegator).from("UserLogin").where("userLoginId", 
"system").queryOne();
         } catch (GenericEntityException e) {
             String errMsg = "Error Getting UserLogin with userLoginId 
'system':" + e.toString();
             Debug.logError(e, errMsg, module);
@@ -325,7 +325,7 @@ public class OagisServices {
             } else {
                 Map<String, Object> originalOmiPkMap = 
UtilMisc.toMap("logicalId", (Object) dataAreaLogicalId, "component", 
dataAreaComponent,
                         "task", dataAreaTask, "referenceId", 
dataAreaReferenceId);
-                GenericValue originalOagisMsgInfo = 
delegator.findOne("OagisMessageInfo", originalOmiPkMap, false);
+                GenericValue originalOagisMsgInfo = 
EntityQuery.use(delegator).from("OagisMessageInfo").where(originalOmiPkMap).queryOne();
                 if (originalOagisMsgInfo != null) {
                     for (Element dataAreaConfirmMsgElement : 
dataAreaConfirmMsgList) {
                         String description = 
UtilXml.childElementValue(dataAreaConfirmMsgElement, "of:DESCRIPTN");
@@ -445,7 +445,7 @@ public class OagisServices {
 
             if (UtilValidate.isNotEmpty(referenceId) && 
(UtilValidate.isEmpty(component) || UtilValidate.isEmpty(task) || 
UtilValidate.isEmpty(referenceId))) {
                 // try looking up by just the referenceId, those alone are 
often unique, return error if there is more than one result
-                List<GenericValue> oagisMessageInfoList = 
delegator.findByAnd("OagisMessageInfo", UtilMisc.toMap("referenceId", 
referenceId), null, false);
+                List<GenericValue> oagisMessageInfoList = 
EntityQuery.use(delegator).from("OagisMessageInfo").where("referenceId", 
referenceId).queryList();
                 if (oagisMessageInfoList.size() == 1) {
                     oagisMessageInfo = oagisMessageInfoList.get(0);
                 } else if (oagisMessageInfoList.size() > 1) {
@@ -453,7 +453,7 @@ public class OagisServices {
                     return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"OagisErrorLookupByReferenceError", UtilMisc.toMap("messageSize", 
messageSize.toString(), "referenceId", referenceId), locale));
                 }
             } else {
-                oagisMessageInfo = delegator.findOne("OagisMessageInfo", 
oagisMessageInfoKey, false);
+                oagisMessageInfo = 
EntityQuery.use(delegator).from("OagisMessageInfo").where(oagisMessageInfoKey).queryOne();
             }
 
             if (oagisMessageInfo == null) {
@@ -548,7 +548,7 @@ public class OagisServices {
         GenericValue oagisMessageInfo = null;
         Map<String, Object> oagisMessageInfoKey = UtilMisc.toMap("logicalId", 
(Object) logicalId, "component", component, "task", task, "referenceId", 
referenceId);
         try {
-            oagisMessageInfo = delegator.findOne("OagisMessageInfo", 
oagisMessageInfoKey, false);
+            oagisMessageInfo = 
EntityQuery.use(delegator).from("OagisMessageInfo").where(oagisMessageInfoKey).queryOne();
         } catch (GenericEntityException e) {
             Debug.logError(e, "Error Getting Entity OagisMessageInfo: " + 
e.toString(), module);
         }

Modified: 
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?rev=1642398&r1=1642397&r2=1642398&view=diff
==============================================================================
--- 
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java 
(original)
+++ 
ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java 
Sat Nov 29 08:00:37 2014
@@ -138,7 +138,7 @@ public class OagisShipmentServices {
         // before getting into this check to see if we've tried once and had 
an error, if so set isErrorRetry even if it wasn't passed in
         GenericValue previousOagisMessageInfo = null;
         try {
-            previousOagisMessageInfo = delegator.findOne("OagisMessageInfo", 
omiPkMap, false);
+            previousOagisMessageInfo = 
EntityQuery.use(delegator).from("OagisMessageInfo").where(omiPkMap).queryOne();
         } catch (GenericEntityException e) {
             String errMsg = "Error getting OagisMessageInfo from database for 
shipment ID [" + shipmentId + "] message ID [" + omiPkMap + "]: " + 
e.toString();
             Debug.logInfo(e, errMsg, module);
@@ -310,7 +310,7 @@ public class OagisShipmentServices {
                                 }
 
                                 if (UtilValidate.isEmpty(shipmentItemList)) {
-                                    shipmentItemList = 
delegator.findByAnd("ShipmentItem", UtilMisc.toMap("shipmentId", shipmentId, 
"productId",productId), null, false);
+                                    shipmentItemList = 
EntityQuery.use(delegator).from("ShipmentItem").where("shipmentId", shipmentId, 
"productId",productId).queryList();
                                     if 
(UtilValidate.isEmpty(shipmentItemList)) {
                                         String errMsg = "Could not find 
Shipment Item for Shipment with ID [" + shipmentId + "] and Product with ID [" 
+ productId + "].";
                                         errorMapList.add(UtilMisc.<String, 
String>toMap("reasonCode", "ShipmentItemForProductNotFound", "description", 
errMsg));
@@ -324,8 +324,7 @@ public class OagisShipmentServices {
                                         if (messageQuantity.intValue() == 
shipmentItem.getDouble("quantity").intValue()) {
                                             // see if there is an ItemIssuance 
for this ShipmentItem, ie has already had inventory issued to it
                                             //if so then move on, this isn't 
the ShipmentItem you want
-                                            List<GenericValue> 
itemIssuanceList = delegator.findByAnd("ItemIssuance",
-                                                    
UtilMisc.toMap("shipmentId", shipmentId, "shipmentItemSeqId", 
shipmentItem.get("shipmentItemSeqId")), null, false);
+                                            List<GenericValue> 
itemIssuanceList = 
EntityQuery.use(delegator).from("ItemIssuance").where("shipmentId", shipmentId, 
"shipmentItemSeqId", shipmentItem.get("shipmentItemSeqId")).queryList();
                                             if (itemIssuanceList.size() == 0) {
                                                 // found a match, set the list 
to be a new list with just this item and then break
                                                 shipmentItemList = 
UtilMisc.toList(shipmentItem);
@@ -346,7 +345,7 @@ public class OagisShipmentServices {
                                 GenericValue shipmentItem = 
shipmentItemList.get(0);
 
                                 String shipmentItemSeqId = 
shipmentItem.getString("shipmentItemSeqId");
-                                GenericValue orderShipment = 
EntityUtil.getFirst(delegator.findByAnd("OrderShipment", 
UtilMisc.toMap("shipmentId", shipmentId, "shipmentItemSeqId", 
shipmentItemSeqId), null, false));
+                                GenericValue orderShipment = 
EntityQuery.use(delegator).from("OrderShipment").where("shipmentId", 
shipmentId, "shipmentItemSeqId", shipmentItemSeqId).queryFirst();
                                 if (orderShipment == null) {
                                     String errMsg = "Could not find 
Order-Shipment record for ShipmentItem with ID [" + shipmentId + "] and Item 
Seq-ID [" + shipmentItemSeqId + "].";
                                     errorMapList.add(UtilMisc.<String, 
String>toMap("reasonCode", "OrderShipmentNotFound", "description", errMsg));
@@ -356,15 +355,13 @@ public class OagisShipmentServices {
 
                                 String orderId = 
orderShipment.getString("orderId");
                                 String orderItemSeqId = 
orderShipment.getString("orderItemSeqId");
-                                GenericValue product = 
delegator.findOne("Product",UtilMisc.toMap("productId", productId), false);
-                                String requireInventory = 
product.getString("requireInventory");
+                                String requireInventory = 
EntityQuery.use(delegator).from("Product").where("productId", 
productId).queryOne().getString("requireInventory");
                                 if (requireInventory == null) {
                                     requireInventory = "N";
                                 }
 
                                 // NOTE: there could be more than one 
reservation record for a given shipment item? for example if there wasn't 
enough quantity in one inventory item and reservations on two were needed
-                                List<GenericValue> 
orderItemShipGrpInvReservationList = 
delegator.findByAnd("OrderItemShipGrpInvRes",
-                                        UtilMisc.toMap("orderId", orderId, 
"orderItemSeqId", orderItemSeqId,"shipGroupSeqId",shipGroupSeqId), null, false);
+                                List<GenericValue> 
orderItemShipGrpInvReservationList = 
EntityQuery.use(delegator).from("OrderItemShipGrpInvRes").where("orderId", 
orderId, "orderItemSeqId", 
orderItemSeqId,"shipGroupSeqId",shipGroupSeqId).queryList();
 
                                 // find the total quantity for all reservations
                                 int totalReserved = 0;
@@ -451,9 +448,8 @@ public class OagisShipmentServices {
                                                 Set<String> productIdSet = 
ProductWorker.getRefurbishedProductIdSet(productId, delegator);
                                                 productIdSet.add(productId);
 
-                                                EntityCondition 
bySerialNumberCondition = 
EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber", 
EntityOperator.EQUALS, serialNumber),
-                                                        EntityOperator.AND, 
EntityCondition.makeCondition("productId", EntityOperator.IN, productIdSet));
-                                                List<GenericValue> 
inventoryItemsBySerialNumber = delegator.findList("InventoryItem", 
bySerialNumberCondition, null, null, null, false);
+                                                List<GenericValue> 
inventoryItemsBySerialNumber = 
EntityQuery.use(delegator).from("InventoryItem").where(EntityCondition.makeCondition(EntityCondition.makeCondition("serialNumber",
 EntityOperator.EQUALS, serialNumber),
+                                                        EntityOperator.AND, 
EntityCondition.makeCondition("productId", EntityOperator.IN, 
productIdSet))).queryList();
                                                 if 
(OagisServices.requireSerialNumberExist.booleanValue()) {
                                                     if 
(inventoryItemsBySerialNumber.size() == 0) {
                                                         String errMsg = 
"Referenced serial numbers must already exist, but serial number [" + 
serialNumber + "] was not found. Product ID(s) considered are: " + productIdSet;
@@ -503,13 +499,12 @@ public class OagisShipmentServices {
                     // NOTE ON THIS DEJ20070906: this is actually really bad 
because it implies the shipment
                     //has been split and that isn't really allowed; maybe 
better to return an error!
 
-                    List<GenericValue> shipmentItemList = 
delegator.findByAnd("ShipmentItem", UtilMisc.toMap("shipmentId", shipmentId), 
null, false);
+                    List<GenericValue> shipmentItemList = 
EntityQuery.use(delegator).from("ShipmentItem").where("shipmentId", 
shipmentId).queryList();
                     for (GenericValue shipmentItem : shipmentItemList) {
                         int shipmentItemQuantity = 
shipmentItem.getDouble("quantity").intValue();
 
                         int totalItemIssuanceQuantity = 0;
-                        List<GenericValue> itemIssuanceList = 
delegator.findByAnd("ItemIssuance", UtilMisc.toMap("shipmentId", shipmentId, 
"shipmentItemSeqId",
-                                shipmentItem.get("shipmentItemSeqId")), null, 
false);
+                        List<GenericValue> itemIssuanceList = 
EntityQuery.use(delegator).from("ItemIssuance").where("shipmentId", shipmentId, 
"shipmentItemSeqId", shipmentItem.get("shipmentItemSeqId")).queryList();
                         for (GenericValue itemIssuance : itemIssuanceList) {
                             totalItemIssuanceQuantity += 
itemIssuance.getDouble("quantity").intValue();
                         }
@@ -704,8 +699,7 @@ public class OagisShipmentServices {
 
         try {
             // see if there are any OagisMessageInfo for this order that are 
in the OAGMP_OGEN_SUCCESS or OAGMP_SENT statuses, if so don't send again; these 
need to be manually reviewed before resending to avoid accidental duplicate 
messages
-            List<GenericValue> previousOagisMessageInfoList = 
delegator.findByAnd("OagisMessageInfo",
-                    UtilMisc.toMap("orderId", orderId, "task", task, 
"component", component), null, false);
+            List<GenericValue> previousOagisMessageInfoList = 
EntityQuery.use(delegator).from("OagisMessageInfo").where("orderId", orderId, 
"task", task, "component", component).queryList();
             if (EntityUtil.filterByAnd(previousOagisMessageInfoList, 
UtilMisc.toMap("processingStatusId", "OAGMP_OGEN_SUCCESS")).size() > 0) {
                 // this isn't really an error, just a failed constraint so 
return success
                 return 
ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, 
"OagisFoundExistingMessage", UtilMisc.toMap("orderId", orderId), locale) + 
EntityUtil.filterByAnd(previousOagisMessageInfoList, 
UtilMisc.toMap("processingStatusId", "OAGMP_OGEN_SUCCESS")));
@@ -792,8 +786,7 @@ public class OagisShipmentServices {
                     EntityCondition.makeCondition("primaryOrderId", 
EntityOperator.EQUALS, orderId),
                     EntityCondition.makeCondition("statusId", 
EntityOperator.NOT_EQUAL, "SHIPMENT_CANCELLED")
                    ), EntityOperator.AND);
-            List<GenericValue> shipmentList = delegator.findList("Shipment", 
findShipmentCondition, null, null, null, false);
-            GenericValue shipment = EntityUtil.getFirst(shipmentList);
+            GenericValue shipment = 
EntityQuery.use(delegator).from("Shipment").where(findShipmentCondition).queryFirst();
 
             if (shipment != null) {
                 // if picked, packed, shipped, delivered then complain, no 
reason to process the shipment!
@@ -809,7 +802,7 @@ public class OagisShipmentServices {
             }
 
             bodyParameters.put("shipment", shipment);
-            List<GenericValue> shipmentItems = 
delegator.findByAnd("ShipmentItem", UtilMisc.toMap("shipmentId", shipmentId), 
null, false);
+            List<GenericValue> shipmentItems = 
EntityQuery.use(delegator).from("ShipmentItem").where("shipmentId", 
shipmentId).queryList();
             bodyParameters.put("shipmentItems", shipmentItems);
 
             GenericValue  address = 
EntityUtil.getFirst(orderReadHelper.getShippingLocations());
@@ -824,7 +817,7 @@ public class OagisShipmentServices {
             }
             bodyParameters.put("telecomNumber", telecomNumber);
 
-            orderItemShipGroup = 
EntityUtil.getFirst(delegator.findByAnd("OrderItemShipGroup", 
UtilMisc.toMap("orderId", orderId), null, false));
+            orderItemShipGroup = 
EntityQuery.use(delegator).from("OrderItemShipGroup").where("orderId", 
orderId).queryFirst();
             bodyParameters.put("orderItemShipGroup", orderItemShipGroup);
             Set<String> correspondingPoIdSet = FastSet.newInstance();
 
@@ -842,13 +835,13 @@ public class OagisShipmentServices {
                 bodyParameters.put("externalIdSet", externalIdSet);
             }
             // Check if order was a return replacement order (associated with 
return)
-            GenericValue returnItemResponse = 
EntityUtil.getFirst(delegator.findByAnd("ReturnItemResponse", 
UtilMisc.toMap("replacementOrderId", orderId), null, false));
+            GenericValue returnItemResponse = 
EntityQuery.use(delegator).from("ReturnItemResponse").where("replacementOrderId",
 orderId).queryFirst();
             if (returnItemResponse != null) {
                 boolean includeReturnLabel = false;
 
                 // Get the associated return Id (replaceReturnId)
                 String returnItemResponseId = 
returnItemResponse.getString("returnItemResponseId");
-                List<GenericValue> returnItemList = 
delegator.findByAnd("ReturnItem", UtilMisc.toMap("returnItemResponseId", 
returnItemResponseId), null, false);
+                List<GenericValue> returnItemList = 
EntityQuery.use(delegator).from("ReturnItem").where("returnItemResponseId", 
returnItemResponseId).queryList();
                 GenericValue firstReturnItem = 
EntityUtil.getFirst(returnItemList);
                 if (firstReturnItem != null) {
                     bodyParameters.put("replacementReturnId", 
firstReturnItem.getString("returnId"));
@@ -873,8 +866,7 @@ public class OagisShipmentServices {
             // tracking shipper account, other Party info
             String partyId = shipment.getString("partyIdTo");
             bodyParameters.put("partyNameView", 
EntityQuery.use(delegator).from("PartyNameView").where("partyId", 
partyId).queryOne());
-            List<GenericValue> partyCarrierAccounts = 
delegator.findByAnd("PartyCarrierAccount", UtilMisc.toMap("partyId", partyId), 
null, false);
-            partyCarrierAccounts = 
EntityUtil.filterByDate(partyCarrierAccounts);
+            List<GenericValue> partyCarrierAccounts = 
EntityQuery.use(delegator).from("PartyCarrierAccount").where("partyId", 
partyId).filterByDate().queryList();
             if (partyCarrierAccounts != null) {
                 for (GenericValue partyCarrierAccount : partyCarrierAccounts) {
                     String carrierPartyId = 
partyCarrierAccount.getString("carrierPartyId");
@@ -947,7 +939,7 @@ public class OagisShipmentServices {
             if (omiPkMap != null) {
                 try {
                     // only do this if there is a record already in place
-                    if (delegator.findOne("OagisMessageInfo", omiPkMap, false) 
== null) {
+                    if 
(EntityQuery.use(delegator).from("OagisMessageInfo").where(omiPkMap).queryOne() 
== null) {
                         return ServiceUtil.returnError(errMsg);
                     }
 
@@ -1021,8 +1013,7 @@ public class OagisShipmentServices {
 
         try {
             // see if there are any OagisMessageInfo for this order that are 
in the OAGMP_OGEN_SUCCESS or OAGMP_SENT statuses, if so don't send again; these 
need to be manually reviewed before resending to avoid accidental duplicate 
messages
-            List<GenericValue> previousOagisMessageInfoList = 
delegator.findByAnd("OagisMessageInfo",
-                    UtilMisc.toMap("returnId", returnId, "task", task, 
"component", component), null, false);
+            List<GenericValue> previousOagisMessageInfoList = 
EntityQuery.use(delegator).from("OagisMessageInfo").where("returnId", returnId, 
"task", task, "component", component).queryList();
             if (EntityUtil.filterByAnd(previousOagisMessageInfoList, 
UtilMisc.toMap("processingStatusId", "OAGMP_OGEN_SUCCESS")).size() > 0) {
                 // this isn't really an error, just a failed constraint so 
return success
                 return 
ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, 
"OagisFoundExistingMessageForReturn", UtilMisc.toMap("returnId", returnId), 
locale) + EntityUtil.filterByAnd(previousOagisMessageInfoList, 
UtilMisc.toMap("processingStatusId", "OAGMP_OGEN_SUCCESS")));
@@ -1041,7 +1032,7 @@ public class OagisShipmentServices {
                 return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"OagisReturnIdNotInAcceptedStatus", UtilMisc.toMap("returnId", returnId), 
locale));
             }
 
-            List<GenericValue> returnItems = delegator.findByAnd("ReturnItem", 
UtilMisc.toMap("returnId", returnId), null, false);
+            List<GenericValue> returnItems = 
EntityQuery.use(delegator).from("ReturnItem").where("returnId", 
returnId).queryList();
             bodyParameters.put("returnItems", returnItems);
 
             orderId = EntityUtil.getFirst(returnItems).getString("orderId");
@@ -1103,9 +1094,9 @@ public class OagisShipmentServices {
                 GenericValue orderItem = returnItem.getRelatedOne("OrderItem", 
false);
                 if (orderItem != null) {
                     if (orderItem.getDouble("quantity").doubleValue() == 
itemQty) {
-                        List<GenericValue> itemIssuanceAndInventoryItemList = 
delegator.findByAnd("ItemIssuanceAndInventoryItem",
-                                UtilMisc.toMap("orderId", 
orderItem.get("orderId"), "orderItemSeqId", orderItem.get("orderItemSeqId"),
-                                        "inventoryItemTypeId", 
"SERIALIZED_INV_ITEM"), null, false);
+                        List<GenericValue> itemIssuanceAndInventoryItemList = 
EntityQuery.use(delegator).from("ItemIssuanceAndInventoryItem")
+                                .where("orderId", orderItem.get("orderId"), 
"orderItemSeqId", orderItem.get("orderItemSeqId"), "inventoryItemTypeId", 
"SERIALIZED_INV_ITEM")
+                                .queryList();
                         if (itemIssuanceAndInventoryItemList.size() == 
itemQty) {
                             List<String> serialNumberList = 
FastList.newInstance();
                             
serialNumberListByReturnItemSeqIdMap.put(returnItem.getString("returnItemSeqId"),
 serialNumberList);
@@ -1190,7 +1181,7 @@ public class OagisShipmentServices {
             if (omiPkMap != null) {
                 try {
                     // only do this if there is a record already in place
-                    if (delegator.findOne("OagisMessageInfo", omiPkMap, false) 
== null) {
+                    if 
(EntityQuery.use(delegator).from("OagisMessageInfo").where(omiPkMap).queryOne() 
== null) {
                         return ServiceUtil.returnError(errMsg);
                     }
 

Modified: 
ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/guiapp/xui/XuiSession.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/guiapp/xui/XuiSession.java?rev=1642398&r1=1642397&r2=1642398&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/guiapp/xui/XuiSession.java 
(original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/guiapp/xui/XuiSession.java Sat 
Nov 29 08:00:37 2014
@@ -32,6 +32,7 @@ import org.ofbiz.webapp.control.LoginWor
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityQuery;
 import org.ofbiz.service.GenericServiceException;
 import org.ofbiz.service.LocalDispatcher;
 import org.ofbiz.service.ServiceUtil;
@@ -160,7 +161,7 @@ public class XuiSession {
         String partyId = userLogin.getString("partyId");
         GenericValue partyRole = null;
         try {
-            partyRole = delegator.findOne("PartyRole", false, "partyId", 
partyId, "roleTypeId", roleTypeId);
+            partyRole = 
EntityQuery.use(delegator).from("PartyRole").where("partyId", partyId, 
"roleTypeId", roleTypeId).queryOne();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
             return false;

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=1642398&r1=1642397&r2=1642398&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java 
(original)
+++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/PosTransaction.java Sat 
Nov 29 08:00:37 2014
@@ -1167,14 +1167,13 @@ public class PosTransaction implements S
 
     public GenericValue getTerminalState() {
         Delegator delegator = session.getDelegator();
-        List<GenericValue> states = null;
+        GenericValue state = null;
         try {
-            states = delegator.findByAnd("PosTerminalState", 
UtilMisc.toMap("posTerminalId", this.getTerminalId()), null, false);
+            state = 
EntityQuery.use(delegator).from("PosTerminalState").where("posTerminalId", 
this.getTerminalId()).filterByDate(UtilDateTime.nowTimestamp(), "openedDate", 
"closedDate").queryFirst();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
         }
-        states = EntityUtil.filterByDate(states, UtilDateTime.nowTimestamp(), 
"openedDate", "closedDate", true);
-        return EntityUtil.getFirst(states);
+        return state;
     }
 
     public void setPrintWriter(PrintWriter writer) {
@@ -1306,7 +1305,7 @@ public class PosTransaction implements S
         List<GenericValue> shoppingLists = null;
         Delegator delegator = this.session.getDelegator();
         try {
-            shoppingLists = delegator.findList("ShoppingList", null, null, 
null, null, false);
+            shoppingLists = 
EntityQuery.use(delegator).from("ShoppingList").queryList();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
             return null;
@@ -1656,9 +1655,14 @@ public class PosTransaction implements S
 
                 try {
                     // set distinct on so we only get one row per person
-                    EntityFindOptions findOpts = new EntityFindOptions(true, 
EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, 
-1, maxRows, true);
                     // using list iterator
-                    EntityListIterator pli = 
delegator.findListIteratorByCondition(dynamicView, mainCond, null, 
fieldsToSelect, orderBy, findOpts);
+                     EntityListIterator pli = 
EntityQuery.use(delegator).select(UtilMisc.toSet(fieldsToSelect))
+                            .from(dynamicView).where(mainCond)
+                            .cursorScrollInsensitive()
+                            .fetchSize(-1)
+                            .maxRows(maxRows)
+                            .cache(true)
+                            .queryIterator();
 
                     // get the partial list for this page
                     partyList = pli.getPartialList(1, maxRows);

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=1642398&r1=1642397&r2=1642398&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 Nov 29 08:00:37 2014
@@ -45,6 +45,7 @@ import org.ofbiz.entity.condition.Entity
 import org.ofbiz.entity.transaction.GenericTransactionException;
 import org.ofbiz.entity.transaction.TransactionUtil;
 import org.ofbiz.entity.util.EntityListIterator;
+import org.ofbiz.entity.util.EntityQuery;
 import org.ofbiz.guiapp.xui.XuiSession;
 import org.ofbiz.pos.PosTransaction;
 import org.ofbiz.pos.adaptor.SyncCallbackAdaptor;
@@ -485,12 +486,10 @@ public class ManagerEvents {
             beganTransaction = TransactionUtil.begin();
 
             Delegator delegator = pos.getSession().getDelegator();
-            List<EntityExpr> exprs = 
UtilMisc.toList(EntityCondition.makeCondition("originFacilityId", 
EntityOperator.EQUALS, trans.getFacilityId()),
-                    EntityCondition.makeCondition("terminalId", 
EntityOperator.EQUALS, trans.getTerminalId()));
             EntityListIterator eli = null;
 
             try {
-                eli = delegator.find("OrderHeaderAndPaymentPref", 
EntityCondition.makeCondition(exprs, EntityOperator.AND), null, null, null, 
null);
+                eli = 
EntityQuery.use(delegator).from("OrderHeaderAndPaymentPref").where("originFacilityId",
 trans.getFacilityId(), "terminalId", trans.getTerminalId()).queryIterator();
             } catch (GenericEntityException e) {
                 Debug.logError(e, module);
             }

Modified: 
ofbiz/trunk/specialpurpose/projectmgr/src/org/ofbiz/project/Various.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/src/org/ofbiz/project/Various.java?rev=1642398&r1=1642397&r2=1642398&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/src/org/ofbiz/project/Various.java 
(original)
+++ ofbiz/trunk/specialpurpose/projectmgr/src/org/ofbiz/project/Various.java 
Sat Nov 29 08:00:37 2014
@@ -28,6 +28,7 @@ import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.Delegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityQuery;
 
 public class Various {
 
@@ -92,7 +93,7 @@ public class Various {
         double actualHours = 0.00;
         if (timesheetId != null) {
             try {
-                List<GenericValue> actuals = delegator.findByAnd("TimeEntry", 
UtilMisc.toMap("timesheetId", timesheetId), null, false);
+                List<GenericValue> actuals = 
EntityQuery.use(delegator).from("TimeEntry").where("timesheetId", 
timesheetId).queryList();
                 if (actuals.size() > 0) {
                     for (GenericValue actual : actuals) {
                         Double hour = (Double) actual.get("hours");

Modified: ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumEvents.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumEvents.java?rev=1642398&r1=1642397&r2=1642398&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumEvents.java 
(original)
+++ ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumEvents.java Sat 
Nov 29 08:00:37 2014
@@ -44,6 +44,7 @@ import org.ofbiz.entity.condition.Entity
 import org.ofbiz.entity.condition.EntityConditionList;
 import org.ofbiz.entity.condition.EntityExpr;
 import org.ofbiz.entity.condition.EntityOperator;
+import org.ofbiz.entity.util.EntityQuery;
 
 /**
  * ScrumEvents - Check The Warning Message. 
@@ -69,9 +70,9 @@ public class ScrumEvents {
             // should be scrum team or scrum master.
             EntityConditionList<EntityExpr> exprOrs = 
EntityCondition.makeCondition(UtilMisc.toList(EntityCondition.makeCondition("roleTypeId",
 EntityOperator.EQUALS, "SCRUM_TEAM"), 
EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, 
"SCRUM_MASTER")), EntityOperator.OR);
             EntityConditionList<EntityCondition> exprAnds = 
EntityCondition.makeCondition(UtilMisc.toList(exprOrs, 
EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, partyId)), 
EntityOperator.AND);
-            List<GenericValue> partyRoleList = delegator.findList("PartyRole", 
exprAnds, null, null, null, false);
+            List<GenericValue> partyRoleList = 
EntityQuery.use(delegator).from("PartyRole").where(exprAnds).queryList();
             if (UtilValidate.isNotEmpty(partyRoleList)) {
-                List<GenericValue> timesheetList = 
delegator.findByAnd("Timesheet", UtilMisc.toMap("partyId", partyId, "statusId", 
"TIMESHEET_IN_PROCESS"), null, true);
+                List<GenericValue> timesheetList = 
EntityQuery.use(delegator).from("Timesheet").where("partyId", partyId, 
"statusId", "TIMESHEET_IN_PROCESS").cache(true).queryList();
                 if (UtilValidate.isNotEmpty(timesheetList)) {
                     for (GenericValue timesheetMap : timesheetList) {
                         String timesheetId = 
timesheetMap.getString("timesheetId");
@@ -85,7 +86,7 @@ public class ScrumEvents {
                                 //check time entry
                                 List<GenericValue> timeEntryList = 
timesheetMap.getRelated("TimeEntry", UtilMisc.toMap("partyId", partyId, 
"timesheetId",timesheetId, "fromDate",realTimeDate), null, false);
                                 //check EmplLeave
-                                List<GenericValue> emplLeaveList = 
delegator.findByAnd("EmplLeave", UtilMisc.toMap("partyId", partyId, "fromDate", 
realTimeDate), null, true);
+                                List<GenericValue> emplLeaveList = 
EntityQuery.use(delegator).from("EmplLeave").where("partyId", partyId, 
"fromDate", realTimeDate).cache(true).queryList();
                                 if (UtilValidate.isEmpty(timeEntryList) && 
UtilValidate.isEmpty(emplLeaveList)) {
                                     Map<String, Object> noEntryMap = 
FastMap.newInstance();
                                     noEntryMap.put("timesheetId", timesheetId);

Modified: 
ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java?rev=1642398&r1=1642397&r2=1642398&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java 
(original)
+++ ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java Sat 
Nov 29 08:00:37 2014
@@ -79,8 +79,7 @@ public class ScrumServices {
                                     communicationEventProduct.create();
                                 }
                                 try {
-                                    List<GenericValue> productRoleList = 
delegator.findByAnd("ProductRole", UtilMisc.toMap("productId",productId, 
"partyId", communicationEvent.getString("partyIdFrom"), 
"roleTypeId","PRODUCT_OWNER"), null, false);
-                                    GenericValue productRoleMap = 
EntityUtil.getFirst(productRoleList);
+                                    GenericValue productRoleMap = 
EntityQuery.use(delegator).from("ProductRole").where("productId",productId, 
"partyId", communicationEvent.getString("partyIdFrom"), 
"roleTypeId","PRODUCT_OWNER").queryFirst();
                                     GenericValue userLogin = (GenericValue) 
context.get("userLogin");
                                     // also close the incoming communication 
event
                                     if 
(UtilValidate.isNotEmpty(productRoleMap)) {
@@ -206,7 +205,7 @@ public class ScrumServices {
                         Debug.logInfo("Revision Link ============== 
>>>>>>>>>>> "+ revisionLink, module);
                         if (UtilValidate.isNotEmpty(taskId)) {
                             String version = "R" + i;
-                            List <GenericValue> workeffContentList = 
delegator.findByAnd("WorkEffortAndContentDataResource", 
UtilMisc.toMap("contentName",version.trim() ,"drObjectInfo", 
revisionLink.trim()), null, false);
+                            List <GenericValue> workeffContentList = 
EntityQuery.use(delegator).from("WorkEffortAndContentDataResource").where("contentName",version.trim()
 ,"drObjectInfo", revisionLink.trim()).queryList();
                             List<EntityCondition> exprsAnd = 
FastList.newInstance();
                             
exprsAnd.add(EntityCondition.makeCondition("workEffortId", 
EntityOperator.EQUALS, taskId));
 
@@ -217,7 +216,7 @@ public class ScrumServices {
                             
exprsOr.add(EntityCondition.makeCondition("workEffortTypeId", 
EntityOperator.EQUALS, "SCRUM_TASK_INST"));
                             
exprsAnd.add(EntityCondition.makeCondition(exprsOr, EntityOperator.OR));
 
-                            List<GenericValue> workEffortList = 
delegator.findList("WorkEffort", EntityCondition.makeCondition(exprsAnd, 
EntityOperator.AND), null, null, null, false);
+                            List<GenericValue> workEffortList = 
EntityQuery.use(delegator).from("WorkEffort").where(exprsAnd).queryList();
                             if (UtilValidate.isEmpty(workeffContentList) && 
UtilValidate.isNotEmpty(workEffortList)) {
                                 Map<String, Object> inputMap = 
FastMap.newInstance();
                                 inputMap.put("taskId", taskId);
@@ -267,7 +266,7 @@ public class ScrumServices {
             
exprsAnd.add(EntityCondition.makeCondition("workEffortContentTypeId", 
EntityOperator.EQUALS, "TASK_SUB_INFO"));
             exprsAnd.add(EntityCondition.makeCondition("contentTypeId", 
EntityOperator.EQUALS, "DOCUMENT"));
             exprsAnd.add(EntityCondition.makeCondition("drObjectInfo", 
EntityOperator.LIKE, revisionLink + "%"));
-            List<GenericValue> workEffortDataResourceList = 
delegator.findList("WorkEffortAndContentDataResource", 
EntityCondition.makeCondition(exprsAnd, EntityOperator.AND), null, null, null, 
false);
+            List<GenericValue> workEffortDataResourceList = 
EntityQuery.use(delegator).from("WorkEffortAndContentDataResource").where(exprsAnd).queryList();
             if (UtilValidate.isNotEmpty(workEffortDataResourceList)) {
                 Debug.logInfo("Total Content Size ============== >>>>>>>>>>> 
"+ workEffortDataResourceList.size(), module);
                 Set<String> keys = FastSet.newInstance();

Modified: 
ofbiz/trunk/specialpurpose/webpos/src/org/ofbiz/webpos/search/WebPosSearch.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/webpos/src/org/ofbiz/webpos/search/WebPosSearch.java?rev=1642398&r1=1642397&r2=1642398&view=diff
==============================================================================
--- 
ofbiz/trunk/specialpurpose/webpos/src/org/ofbiz/webpos/search/WebPosSearch.java 
(original)
+++ 
ofbiz/trunk/specialpurpose/webpos/src/org/ofbiz/webpos/search/WebPosSearch.java 
Sat Nov 29 08:00:37 2014
@@ -34,6 +34,7 @@ import org.ofbiz.entity.condition.Entity
 import org.ofbiz.entity.model.DynamicViewEntity;
 import org.ofbiz.entity.model.ModelKeyMap;
 import org.ofbiz.entity.util.EntityListIterator;
+import org.ofbiz.entity.util.EntityQuery;
 import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.ServiceUtil;
@@ -52,16 +53,8 @@ public class WebPosSearch {
         
         List<EntityCondition> andExprs = FastList.newInstance();
         EntityCondition mainCond = null;
-        List<String> orderBy = FastList.newInstance();
-        List<String> fieldsToSelect = FastList.newInstance();
         String entityName = "Product";
         
-        fieldsToSelect.add("productId");
-        fieldsToSelect.add("productName");
-        fieldsToSelect.add("description");
-        orderBy.add("productName");
-        orderBy.add("description");
-        
         // search by product name
         if (UtilValidate.isNotEmpty(searchByProductName)) {
             searchByProductName = searchByProductName.toUpperCase().trim();
@@ -84,7 +77,7 @@ public class WebPosSearch {
         mainCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND);
         List<GenericValue> products = null;
         try {
-            products = delegator.findList(entityName, mainCond, null, orderBy, 
null, false);
+            products = 
EntityQuery.use(delegator).from(entityName).where(mainCond).orderBy("productName",
 "description").queryList();
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
         }


Reply via email to