Examples of findCountByCondition()


Examples of org.ofbiz.entity.Delegator.findCountByCondition()

    public static long categoryRollupCount(GenericValue category) {
        if (category == null) return 0;
        Delegator delegator = category.getDelegator();
        long count = 0;
        try {
            count = delegator.findCountByCondition("ProductCategoryRollup", buildCountCondition("parentProductCategoryId", category.getString("productCategoryId")), null, null);
        } catch (GenericEntityException e) {
            Debug.logError(e, module);
        }
        return count;
    }
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findCountByCondition()

                            EntityCondition.makeCondition(EntityCondition.makeCondition("statusEndDatetime", EntityOperator.GREATER_THAN, snapshotDate), EntityOperator.OR, EntityCondition.makeCondition("statusEndDatetime", EntityOperator.EQUALS, null)),
                            EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId),
                            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);
                    quantityOnHandTotal += invItemQuantCount;

                    // check for mismatch in quantity
                    if (itemQty != quantityOnHandTotal) {
                        double quantityDiff = Math.abs((itemQty - quantityOnHandTotal));
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findCountByCondition()

    public int getExecuteCount(String procId, String asDefId, String aDefId, SharkTransaction trans) throws PersistenceException {

        Delegator delegator = SharkContainer.getDelegator();
        long count = 0;
        try {
            count = delegator.findCountByCondition(org.ofbiz.shark.SharkConstants.WfActivity, EntityCondition.makeCondition(UtilMisc.toMap(org.ofbiz.shark.SharkConstants.processId, procId, org.ofbiz.shark.SharkConstants.setDefinitionId, asDefId, org.ofbiz.shark.SharkConstants.definitionId, aDefId)), null, null);
        } catch (GenericEntityException e) {
            throw new PersistenceException(e);
        }

        return (int) count;
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findCountByCondition()

            message = "PONG";
        }

        long count = -1;
        try {
            count = delegator.findCountByCondition("SequenceValueItem", null, null, null);
        } catch (GenericEntityException e) {
            Debug.logError(e.getMessage(), module);
            return ServiceUtil.returnError("Unable to connect to datasource!");
        }
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findCountByCondition()

        try {
            // begin the transaction
            beganTx = TransactionUtil.begin(7200);
            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);
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findCountByCondition()

            EntityCondition havingEntityCondition = null;
            if (this.havingCondition != null) {
                havingEntityCondition = this.havingCondition.createCondition(context, modelEntity, delegator.getModelFieldTypeReader(modelEntity));
            }

            long count = delegator.findCountByCondition(entityName, whereEntityCondition, havingEntityCondition, null);

            this.countAcsr.put(context, count);
        } catch (GeneralException e) {
            Debug.logError(e, module);
            String errMsg = "ERROR: Could not complete the " + simpleMethod.getShortDescription() + " process: " + e.getMessage();
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findCountByCondition()

            message = "PONG";
        }

        long count = -1;
        try {
            count = delegator.findCountByCondition("SequenceValueItem", null, null, null);
        } catch (GenericEntityException e) {
            Debug.logError(e.getMessage(), module);
            return ServiceUtil.returnError("Unable to connect to datasource!");
        }
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findCountByCondition()

    public int getExecuteCount(String procId, String asDefId, String aDefId, SharkTransaction trans) throws PersistenceException {

        Delegator delegator = SharkContainer.getDelegator();
        long count = 0;
        try {
            count = delegator.findCountByCondition(org.ofbiz.shark.SharkConstants.WfActivity, EntityCondition.makeCondition(UtilMisc.toMap(org.ofbiz.shark.SharkConstants.processId, procId, org.ofbiz.shark.SharkConstants.setDefinitionId, asDefId, org.ofbiz.shark.SharkConstants.definitionId, aDefId)), null, null);
        } catch (GenericEntityException e) {
            throw new PersistenceException(e);
        }

        return (int) count;
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findCountByCondition()

    public static long categoryMemberCount(GenericValue category) {
        if (category == null) return 0;
        Delegator delegator = category.getDelegator();
        long count = 0;
        try {
            count = delegator.findCountByCondition("ProductCategoryMember", buildCountCondition("productCategoryId", category.getString("productCategoryId")), null, null);
        } catch (GenericEntityException e) {
            Debug.logError(e, module);
        }
        return count;
    }
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findCountByCondition()

    public static long categoryRollupCount(GenericValue category) {
        if (category == null) return 0;
        Delegator delegator = category.getDelegator();
        long count = 0;
        try {
            count = delegator.findCountByCondition("ProductCategoryRollup", buildCountCondition("parentProductCategoryId", category.getString("productCategoryId")), null, null);
        } catch (GenericEntityException e) {
            Debug.logError(e, module);
        }
        return count;
    }
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.