Package org.ofbiz.entity

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


        condList.add(expr);
        expr = EntityCondition.makeCondition("caThruDate", EntityOperator.EQUALS, null);
        condList.add(expr);
        EntityConditionList entityCondList = EntityCondition.makeCondition(condList, EntityOperator.AND);
         try {
             List lst = delegator.findList("ContentAssocDataResourceViewFrom", entityCondList, null, UtilMisc.toList("caSequenceNum", "caFromDate", "createdDate"), null, false);
             results.put("_LIST_", lst);
        } catch (GenericEntityException e) {
            Debug.logError(e, module);
            return ServiceUtil.returnError(e.toString());
        }
View Full Code Here


            } else {
                Debug.logError("Exception during building data items to Google, Country Code must be either US, UK or DE: "+countryCode, module);
                return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "productsExportToGoogle.invalidCountryCode", locale));
            }
            // Get the list of products to be exported to Google Base
            List productsList  = delegator.findList("Product", EntityCondition.makeCondition("productId", EntityOperator.IN, selectResult), null, null, null, false);

            // Get the tracking code
            if (UtilValidate.isEmpty(trackingCodeId) || "_NA_".equals(trackingCodeId)) {
                trackingCodeId = "";
            } else {
View Full Code Here

        try {
            // find the largest keepRemoveInfoHours value on an EntitySyncRemove and kill everything before that, if none found default to 10 days (240 hours)
            double keepRemoveInfoHours = 24;

            List<GenericValue> entitySyncRemoveList = delegator.findList("EntitySync", null, null, null, null, false);
            for (GenericValue entitySyncRemove: entitySyncRemoveList) {
                Double curKrih = entitySyncRemove.getDouble("keepRemoveInfoHours");
                if (curKrih != null) {
                    double curKrihVal = curKrih.doubleValue();
                    if (curKrihVal > keepRemoveInfoHours) {
View Full Code Here

            if ("Y".equals(addToCartRemoveIncompat)) {
                List productAssocs = null;
                EntityCondition cond = EntityCondition.makeCondition(UtilMisc.toList(
                        EntityCondition.makeCondition(EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId), EntityOperator.OR, EntityCondition.makeCondition("productIdTo", EntityOperator.EQUALS, productId)),
                        EntityCondition.makeCondition("productAssocTypeId", EntityOperator.EQUALS, "PRODUCT_INCOMPATABLE")), EntityOperator.AND);
                productAssocs = delegator.findList("ProductAssoc", cond, null, null, null, false);
                productAssocs = EntityUtil.filterByDate(productAssocs);
                List productList = FastList.newInstance();
                Iterator iter = productAssocs.iterator();
                while (iter.hasNext()) {
                    GenericValue productAssoc = (GenericValue) iter.next();
View Full Code Here

            if ("Y".equals(addToCartReplaceUpsell)) {
                List productList = null;
                EntityCondition cond = EntityCondition.makeCondition(UtilMisc.toList(
                        EntityCondition.makeCondition("productIdTo", EntityOperator.EQUALS, productId),
                        EntityCondition.makeCondition("productAssocTypeId", EntityOperator.EQUALS, "PRODUCT_UPGRADE")), EntityOperator.AND);
                productList = delegator.findList("ProductAssoc", cond, UtilMisc.toSet("productId"), null, null, false);
                if (productList != null) {
                    Iterator sciIter = cart.iterator();
                    while (sciIter.hasNext()) {
                        ShoppingCartItem sci = (ShoppingCartItem) sciIter.next();
                        if (productList.contains(sci.getProductId())) {
View Full Code Here

    public List createShoppingLists() {
        List shoppingLists = null;
        GenericDelegator delegator = this.session.getDelegator();
        try {
            shoppingLists = delegator.findList("ShoppingList", null, null, null, null, false);
        } catch (GenericEntityException e) {
            Debug.logError(e, module);
            ServiceUtil.returnError("Error running initLowLevelCode: " + e.getMessage());
        }
View Full Code Here

            exprs.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PAYMENT_RECEIVED"));
            exprs.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PAYMENT_CANCELLED"));
            exprs.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PAYMENT_DECLINED"));
            exprs.add(EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PAYMENT_SETTLED"));
            EntityCondition cond = EntityCondition.makeCondition(exprs, EntityOperator.AND);
            orderPaymentPrefs = delegator.findList("OrderPaymentPreference", cond, null, null, null, false);
        } catch (GenericEntityException e) {
            Debug.logError(e, module);
            return ServiceUtil.returnError(e.getMessage());
        }
        if (UtilValidate.isNotEmpty(orderPaymentPrefs)) {
View Full Code Here

    public GenericValue getTerminalState() {
        GenericDelegator delegator = webPosSession.getDelegator();
        List<GenericValue> states = null;
        try {
            states = delegator.findList("PosTerminalState", EntityCondition.makeCondition(UtilMisc.toMap("posTerminalId", webPosSession.getId(), "startingTxId", getTransactionId())), null, null, null, false);
        } catch (GenericEntityException e) {
            Debug.logError(e, module);
        }
        states = EntityUtil.filterByDate(states, UtilDateTime.nowTimestamp(), "openedDate", "closedDate", true);
        return EntityUtil.getFirst(states);
View Full Code Here

                        StringBuilder keyBuffer = new StringBuilder();
                        keyBuffer.append(entityName);
                        keyBuffer.append('.');
                        keyBuffer.append(fieldName);
                        List<GenericValue> entityRecords = delegator.findList(
                                entityName, ecl, pkFields, null, null, false);

                        for (GenericValue entityRecord : entityRecords) {
                            boolean pkFound = false;
                            StringBuilder pkBuffer = new StringBuilder(
View Full Code Here

                        String fieldName = fieldsIt.next();
                        StringBuilder keyBuffer = new StringBuilder();
                        keyBuffer.append(entityName);
                        keyBuffer.append('.');
                        keyBuffer.append(fieldName);
                        List<GenericValue> entityRecords = delegator.findList(
                                entityName, null, pkFields, null, null, false);

                        for (GenericValue entityRecord : entityRecords) {
                            boolean pkFound = false;
                            StringBuilder pkBuffer = new StringBuilder(
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.