Package org.ofbiz.entity

Examples of org.ofbiz.entity.GenericDelegator.find()


       
        // Retrieve entities  - an iterator over all the values
        EntityListIterator listIt = null;
        try {
            if (noConditionFind || (entityConditionList != null && entityConditionList.getConditionListSize() > 0)) {
                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());
        }
View Full Code Here


                            continue;
                        }

                        // 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.find(curEntityName, null, null, null, me.getPkFieldNames(), null);
                        } catch (Exception entityEx) {
                            results.add("["+fileNumber +"] [xxx] Error when writing " + curEntityName + ": " + entityEx);
                            continue;
                        }
View Full Code Here

            if (conditions.size() > 0) {
                cond = EntityCondition.makeCondition(conditions);
            }
            if (cond != null || "Y".equals(showAll)) {
                try {
                    eli = delegator.find("JobSandbox", cond, null, null, orderBy, findOpts);
             
                    // get the indexes for the partial list
                    lowIndex = viewIndex * viewSize + 1;
                    highIndex = (viewIndex + 1) * viewSize;
               
View Full Code Here

            List exprs = UtilMisc.toList(EntityCondition.makeCondition("automaticExtend", EntityOperator.EQUALS, "Y"),
                    EntityCondition.makeCondition("orderId", EntityOperator.NOT_EQUAL, null),
                    EntityCondition.makeCondition("productId", EntityOperator.NOT_EQUAL, null));
            EntityCondition cond = EntityCondition.makeCondition(exprs, EntityOperator.AND);
            EntityListIterator eli = null;
            eli = delegator.find("Subscription", cond, null, null, null, null);
   
            if (eli != null) {
                GenericValue subscription;
                while (((subscription = (GenericValue) eli.next()) != null)) {
View Full Code Here

                        EntityCondition.makeCondition("finAccountId", EntityOperator.EQUALS, finAccountId));
                EntityCondition condition = EntityCondition.makeCondition(exprs, EntityOperator.AND);

                EntityListIterator eli = null;
                try {
                    eli = delegator.find("FinAccountTrans", condition, null, null, UtilMisc.toList("-transactionDate"), null);

                    GenericValue trans;
                    while (remainingBalance.compareTo(FinAccountHelper.ZERO) == 1 && (trans = (GenericValue) eli.next()) != null) {
                        String orderId = trans.getString("orderId");
                        String orderItemSeqId = trans.getString("orderItemSeqId");
View Full Code Here

                    EntityCondition.makeCondition("isActive", EntityOperator.EQUALS, "Y"));
            EntityCondition cond = EntityCondition.makeCondition(exprs, EntityOperator.AND);
            List order = UtilMisc.toList("-lastOrderedDate");

            EntityListIterator eli = null;
            eli = delegator.find("ShoppingList", cond, null, null, order, null);
   
            if (eli != null) {
                GenericValue shoppingList;
                while (((shoppingList = (GenericValue) eli.next()) != null)) {
                    Timestamp lastOrder = shoppingList.getTimestamp("lastOrderedDate");
View Full Code Here

        }
        Set fields = UtilMisc.toSet("orderId");

        EntityListIterator eli = null;
        try {
            eli = delegator.find("OrderHeader", cond, null, fields, null, null);
        } catch (GenericEntityException e) {
            Debug.logError(e, module);
            return ServiceUtil.returnError(e.getMessage());
        }
View Full Code Here

            try {
                if (Debug.infoOn()) {
                    long count = delegator.findCountByCondition("Product", condition, null, null);
                    Debug.logInfo("========== Found " + count + " products to index ==========", module);
                }
                entityListIterator = delegator.find("Product", condition, null, null, null, null);
            } catch (GenericEntityException gee) {
                Debug.logWarning(gee, gee.getMessage(), module);
                Map messageMap = UtilMisc.toMap("gee", gee.toString());
                errMsg = UtilProperties.getMessage(resource,"productevents.error_getting_product_list", messageMap, UtilHttp.getLocale(request));
                request.setAttribute("_ERROR_MESSAGE_", errMsg);
View Full Code Here

        condList.add(EntityCondition.makeCondition("thruDate", EntityOperator.NOT_EQUAL, null));
        condList.add(EntityCondition.makeCondition("thruDate", EntityOperator.LESS_THAN, nowTimestamp));
        EntityCondition cond = EntityCondition.makeCondition(condList, EntityOperator.AND);
       
        try {
            EntityListIterator eli = delegator.find("ProductStorePromoAndAppl", cond, null, null, null, null);
            GenericValue productStorePromoAndAppl = null;
            while ((productStorePromoAndAppl = (GenericValue) eli.next()) != null) {
                GenericValue productStorePromo = delegator.makeValue("ProductStorePromoAppl");
                productStorePromo.setAllFields(productStorePromoAndAppl, true, null, null);
                productStorePromo.remove();
View Full Code Here

            if (useIterator) {
                EntityCondition whereCond = null;
                if (!mapAcsr.isEmpty()) {
                    whereCond = EntityCondition.makeCondition((Map) mapAcsr.get(methodContext));
                }
                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));
                } else {
                    listAcsr.put(methodContext, delegator.findByAnd(entityName, (Map) mapAcsr.get(methodContext), orderByNames));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.