Package org.ofbiz.entity

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


                        Entity.set("createdDate", UtilDateTime.nowTimestamp());
                        Entity.set("lastUpdatedStamp",UtilDateTime.nowTimestamp());
                        Entity.set("lastUpdatedTxStamp",UtilDateTime.nowTimestamp());
                        Entity.set("createdStamp",UtilDateTime.nowTimestamp());
                        Entity.set("createdTxStamp",UtilDateTime.nowTimestamp());
                        delegator.create(Entity);

                        Map<String, Object> contentAssoc = FastMap.newInstance();
                        contentAssoc.put("contentId", "HOME_DUCUMENT");
                        contentAssoc.put("contentAssocTypeId", "TREE_CHILD");
                        contentAssoc.put("contentIdTo", "ROOT");
View Full Code Here


                                            Entity.set("createdDate", UtilDateTime.nowTimestamp());
                                            Entity.set("lastUpdatedStamp",UtilDateTime.nowTimestamp());
                                            Entity.set("lastUpdatedTxStamp",UtilDateTime.nowTimestamp());
                                            Entity.set("createdStamp",UtilDateTime.nowTimestamp());
                                            Entity.set("createdTxStamp",UtilDateTime.nowTimestamp());
                                            delegator.create(Entity);
                                            hasFolder = false;
                                        } else {
                                            //Debug.log("Content Name = [ "+contentId+"] already exist.");//ShoW log file
                                            hasFolder = true;
                                        }
View Full Code Here

                        Entity.set("createdDate", UtilDateTime.nowTimestamp());
                        Entity.set("lastUpdatedStamp",UtilDateTime.nowTimestamp());
                        Entity.set("lastUpdatedTxStamp",UtilDateTime.nowTimestamp());
                        Entity.set("createdStamp",UtilDateTime.nowTimestamp());
                        Entity.set("createdTxStamp",UtilDateTime.nowTimestamp());
                        delegator.create(Entity);

                        //Relation Content
                        Map<String,Object> contentAssoc = FastMap.newInstance();
                        contentAssoc.put("contentId", contentId);
                        contentAssoc.put("contentAssocTypeId", "SUB_CONTENT");
View Full Code Here

                        Entity.set("createdDate", UtilDateTime.nowTimestamp());
                        Entity.set("lastUpdatedStamp",UtilDateTime.nowTimestamp());
                        Entity.set("lastUpdatedTxStamp",UtilDateTime.nowTimestamp());
                        Entity.set("createdStamp",UtilDateTime.nowTimestamp());
                        Entity.set("createdTxStamp",UtilDateTime.nowTimestamp());
                        delegator.create(Entity);

                        //create ContentAssoc
                        Map<String,Object> contentAssoc = FastMap.newInstance();
                        contentAssoc.put("contentId", contentId);
                        contentAssoc.put("contentAssocTypeId", "SUB_CONTENT");
View Full Code Here

        affiliate = delegator.makeValue("Affiliate", UtilMisc.toMap("partyId", partyId));
        affiliate.setNonPKFields(context);
        affiliate.set("dateTimeCreated", now, false);

        try {
            delegator.create(affiliate);
        } catch (GenericEntityException e) {
            Debug.logWarning(e.getMessage(), module);
            Map<String, String> messageMap = UtilMisc.toMap("errMessage", e.getMessage());
            errMsg = UtilProperties.getMessage(resource,"partyservices.could_not_add_affiliate_info_write", messageMap, locale);
            return ServiceUtil.returnError(errMsg);
View Full Code Here

        // Set the party info
        try {
            Map<String, String> fields = UtilMisc.toMap("partyId", partyId, "noteId", noteId);
            GenericValue v = delegator.makeValue("PartyNote", fields);

            delegator.create(v);
        } catch (GenericEntityException ee) {
            Debug.logError(ee, module);
            Map<String, String> messageMap = UtilMisc.toMap("errMessage", ee.getMessage());
            errMsg = UtilProperties.getMessage(resource,"partyservices.problem_associating_note_with_party", messageMap, locale);
            result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR);
View Full Code Here

        try {
            roleType = delegator.makeValue("RoleType");
            roleType.setPKFields(context);
            roleType.setNonPKFields(context);
            roleType = delegator.create(roleType);
        } catch (GenericEntityException e) {
            Debug.logError(e, module);
            return ServiceUtil.returnError("Cannot create role type entity (write failure): " + e.getMessage());
        }
        if (roleType != null) {
View Full Code Here

        GenericValue linkAttr = delegator.makeValue("PartyAttribute");
        linkAttr.set("partyId", partyId);
        linkAttr.set("attrName", "LINKED_TO");
        linkAttr.set("attrValue", partyIdTo);
        try {
            delegator.create(linkAttr);
        } catch (GenericEntityException e) {
            Debug.logError(e, module);
            return ServiceUtil.returnError(e.getMessage());
        }
View Full Code Here

                    }

                    addrMap.put("sequenceNum", Long.valueOf(seq));
                    Debug.log("Creating map entry: " + addrMap, module);
                    try {
                        delegator.create(addrMap);
                    } catch (GenericEntityException e) {
                        Debug.logError(e, module);
                        return ServiceUtil.returnError(e.getMessage());
                    }
                }
View Full Code Here

            GenericValue newPartyContactMechPurpose = delegator.makeValue("PartyContactMechPurpose",
                    UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId,
                        "fromDate", fromDate));

            try {
                delegator.create(newPartyContactMechPurpose);
            } catch (GenericEntityException e) {
                Debug.logWarning(e.getMessage(), module);
                Map<String, String> messageMap = UtilMisc.toMap("errMessage", e.getMessage());
                errMsg = UtilProperties.getMessage(resource,"contactmechservices.could_not_add_purpose_write", messageMap, locale);
                return ServiceUtil.returnError(errMsg);
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.