Package org.ofbiz.entity

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


        while (iteratorResult.hasNext()) {
            genericResult = (GenericValue) iteratorResult.next();
            String customTimePeriodId =  genericResult.getString("customTimePeriodId");
            GenericValue customTimePeriod = null;
            try {
                customTimePeriod = delegator.findOne("CustomTimePeriod", UtilMisc.toMap("customTimePeriodId", customTimePeriodId), false);
            } catch (GenericEntityException e) {
                return ServiceUtil.returnError("Problem, we can not find CustomTimePeriod, for more detail look at the log");
            }
            if (customTimePeriod.getDate("thruDate").before(UtilDateTime.nowDate())) {
                continue;
View Full Code Here


        }

        GenericValue supposedUserLogin = null;

        try {
            supposedUserLogin = delegator.findOne("UserLogin", false, "userLoginId", userLoginId);
        } catch (GenericEntityException gee) {
            Debug.logWarning(gee, "", module);
        }
        if (supposedUserLogin == null) {
            // the Username was not found
View Full Code Here

        GenericValue supposedUserLogin = null;
        String passwordToSend = null;

        try {
            supposedUserLogin = delegator.findOne("UserLogin", false, "userLoginId", userLoginId);
            if (supposedUserLogin == null) {
                // the Username was not found
                errMsg = UtilProperties.getMessage(resource, "loginevents.username_not_found_reenter", UtilHttp.getLocale(request));
                request.setAttribute("_ERROR_MESSAGE_", errMsg);
                return "error";
View Full Code Here

        }

        // get the ProductStore email settings
        GenericValue productStoreEmail = null;
        try {
            productStoreEmail = delegator.findOne("ProductStoreEmailSetting", false, "productStoreId", productStoreId, "emailType", "PRDS_PWD_RETRIEVE");
        } catch (GenericEntityException e) {
            Debug.logError(e, "Problem getting ProductStoreEmailSetting", module);
        }

        if (productStoreEmail == null) {
View Full Code Here

        partyRelationshipType.set("roleTypeIdValidTo", context.get("roleTypeIdValidTo"), false);
        partyRelationshipType.set("description", context.get("description"), false);
        partyRelationshipType.set("partyRelationshipName", context.get("partyRelationshipName"), false);

        try {
            if (delegator.findOne(partyRelationshipType.getEntityName(), partyRelationshipType.getPrimaryKey(), false) != null) {
                return ServiceUtil.returnError("Could not create party relationship type: already exists");
            }
        } catch (GenericEntityException e) {
            Debug.logWarning(e, module);
            return ServiceUtil.returnError("Could not create party relationship type (read failure): " + e.getMessage());
View Full Code Here

                                    Debug.logError(e, "Could not create new visitor:", module);
                                    visitor = null;
                                }
                            } else {
                                try {
                                    visitor = delegator.findOne("Visitor", false, "visitorId", cookieVisitorId);
                                    if (visitor == null) {
                                        // looks like we have an ID that doesn't exist in our database, so we'll create a new one
                                        visitor = delegator.makeValue("Visitor");
                                        visitor = delegator.createSetNextSeqId(visitor);
                                        if (Debug.infoOn()) Debug.logInfo("The visitorId [" + cookieVisitorId + "] found in cookie was invalid, creating new Visitor with ID [" + visitor.getString("visitorId") + "]", module);
View Full Code Here

        // if the updateMode is CREATE, check to see if an entity with the specified primary key already exists
        if (updateMode.equals("CREATE")) {
            GenericValue tempEntity = null;

            try {
                tempEntity = delegator.findOne(findByEntity.getEntityName(), findByEntity.getPrimaryKey(), false);
            } catch (GenericEntityException e) {
                String errMsg = UtilProperties.getMessage(GenericWebEvent.err_resource, "genericWebEvent.create_failed_by_check", locale) + ": " + e.toString();
                Debug.logWarning(e, errMsg, module);

                request.setAttribute("_ERROR_MESSAGE_", errMsg);
View Full Code Here

       
        String responseString = "";
       
        GenericValue visit = null;
        try {
            visit = delegator.findOne("Visit", false, "visitId", visitId);                            
        } catch (GenericEntityException e) {
            Debug.logError(e, "Cannot Visit Object", module);
        }
      
        if (visit != null && visit.getString("sessionId").equals(sessionId) && appletSessions.containsKey(sessionId)) {           
View Full Code Here

               
        String responseString = "ERROR";
       
        GenericValue visit = null;
        try {
            visit = delegator.findOne("Visit", false, "visitId", visitId);                            
        } catch (GenericEntityException e) {
            Debug.logError(e, "Cannot Visit Object", module);
        }       
       
        if (visit.getString("sessionId").equals(sessionId)) {                                                                            
View Full Code Here

        if (updateMode.equals("DELETE")) {
            GenericValue productAssoc = null;

            try {
                productAssoc = delegator.findOne(tempProductAssoc.getEntityName(), tempProductAssoc.getPrimaryKey(), false);
            } catch (GenericEntityException e) {
                Debug.logWarning(e.getMessage(), module);
                productAssoc = null;
            }
            if (productAssoc == null) {
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.