Examples of removeByPrimaryKey()


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

            Iterator productFeatureAndApplIter = productFeatureAndAppls.iterator();
            while (productFeatureAndApplIter.hasNext()) {
                GenericValue productFeatureAndAppl = (GenericValue) productFeatureAndApplIter.next();
                GenericPK productFeatureApplPK = delegator.makePK("ProductFeatureAppl");
                productFeatureApplPK.setPKFields(productFeatureAndAppl);
                delegator.removeByPrimaryKey(productFeatureApplPK);
            }
        } catch (GenericEntityException e) {
            String errMsg = "Error creating new virtual product from variant products: " + e.toString();
            request.setAttribute("_ERROR_MESSAGE_", errMsg);
            return "error";
View Full Code Here

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

                Iterator productFeatureAndApplIter = productFeatureAndAppls.iterator();
                while (productFeatureAndApplIter.hasNext()) {
                    GenericValue productFeatureAndAppl = (GenericValue) productFeatureAndApplIter.next();
                    GenericPK productFeatureApplPK = delegator.makePK("ProductFeatureAppl", null);
                    productFeatureApplPK.setPKFields(productFeatureAndAppl);
                    delegator.removeByPrimaryKey(productFeatureApplPK);
                }
            }
            List productFeatureAndAppls = product.getRelated("ProductFeatureAndAppl", UtilMisc.toMap("productFeatureTypeId", productFeatureTypeId, "productFeatureApplTypeId", "SELECTABLE_FEATURE"), null);
            Iterator productFeatureAndApplIter = productFeatureAndAppls.iterator();
            while (productFeatureAndApplIter.hasNext()) {
View Full Code Here

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

            Iterator productFeatureAndApplIter = productFeatureAndAppls.iterator();
            while (productFeatureAndApplIter.hasNext()) {
                GenericValue productFeatureAndAppl = (GenericValue) productFeatureAndApplIter.next();
                GenericPK productFeatureApplPK = delegator.makePK("ProductFeatureAppl", null);
                productFeatureApplPK.setPKFields(productFeatureAndAppl);
                delegator.removeByPrimaryKey(productFeatureApplPK);
            }
        } catch (GenericEntityException e) {
            String errMsg = "Error creating new virtual product from variant products: " + e.toString();
            request.setAttribute("_ERROR_MESSAGE_", errMsg);
            return "error";
View Full Code Here

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

        // if this is a delete, do that before getting all of the non-pk parameters and validating them
        if (updateMode.equals("DELETE")) {
            // Remove associated/dependent entries from other tables here
            // Delete actual main entity last, just in case database is set up to do a cascading delete, caches won't get cleared
            try {
                delegator.removeByPrimaryKey(findByEntity.getPrimaryKey());
            } catch (GenericEntityException e) {
                String errMsg = UtilProperties.getMessage(GenericWebEvent.err_resource, "genericWebEvent.delete_failed", locale) + ": " + e.toString();
                Debug.logWarning(e, errMsg, module);
                request.setAttribute("_ERROR_MESSAGE_", errMsg);
                return "error";
View Full Code Here

Examples of org.ofbiz.entity.datasource.GenericHelper.removeByPrimaryKey()

            GenericValue removedEntity = null;
            if (testMode) {
                removedEntity = this.findOne(primaryKey.getEntityName(), primaryKey, false);
            }
            int num = helper.removeByPrimaryKey(primaryKey);
            if (doCacheClear) {
                ecaRunner.evalRules(EntityEcaHandler.EV_CACHE_CLEAR, EntityEcaHandler.OP_REMOVE, primaryKey, false);
                this.clearCacheLine(primaryKey);
            }
View Full Code Here

Examples of org.ofbiz.entity.datasource.GenericHelper.removeByPrimaryKey()

            GenericValue removedValue = null;
            if (testMode) {
                removedValue = this.findOne(value.getEntityName(), value.getPrimaryKey(), false);
            }

            int num = helper.removeByPrimaryKey(value.getPrimaryKey());
            // Need to call removedFromDatasource() here because the helper calls removedFromDatasource() on the PK instead of the GenericEntity.
            value.removedFromDatasource();
            if (doCacheClear) {
                ecaRunner.evalRules(EntityEcaHandler.EV_CACHE_CLEAR, EntityEcaHandler.OP_REMOVE, value, false);
                this.clearCacheLine(value);
View Full Code Here

Examples of org.ofbiz.entity.datasource.GenericHelper.removeByPrimaryKey()

            GenericValue removedEntity = null;
            if (testMode) {
                removedEntity = this.findOne(primaryKey.entityName, primaryKey, false);
            }
            int num = helper.removeByPrimaryKey(primaryKey);
            this.saveEntitySyncRemoveInfo(primaryKey);

            if (testMode) {
                if (removedEntity != null) {
                    storeForTestRollback(new TestOperation(OperationType.DELETE, removedEntity));
View Full Code Here

Examples of org.ofbiz.entity.datasource.GenericHelper.removeByPrimaryKey()

            GenericValue removedValue = null;
            if (testMode) {
                removedValue = this.findOne(value.getEntityName(), value.getPrimaryKey(), false);
            }

            int num = helper.removeByPrimaryKey(value.getPrimaryKey());

            if (testMode) {
                if (removedValue != null) {
                    storeForTestRollback(new TestOperation(OperationType.DELETE, removedValue));
                }
View Full Code Here

Examples of org.ofbiz.entity.datasource.GenericHelper.removeByPrimaryKey()

            GenericValue removedEntity = null;
            if (testMode) {
                removedEntity = this.findOne(primaryKey.entityName, primaryKey, false);
            }
            int num = helper.removeByPrimaryKey(primaryKey);
            this.saveEntitySyncRemoveInfo(primaryKey);

            if (testMode) {
                storeForTestRollback(new TestOperation(OperationType.DELETE, removedEntity));
            }
View Full Code Here

Examples of org.ofbiz.entity.datasource.GenericHelper.removeByPrimaryKey()

            GenericValue removedValue = null;
            if (testMode) {
                removedValue = this.findOne(value.getEntityName(), value.getPrimaryKey(), false);
            }

            int num = helper.removeByPrimaryKey(value.getPrimaryKey());

            if (testMode) {
                storeForTestRollback(new TestOperation(OperationType.DELETE, removedValue));
            }
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.