Package org.hoteia.qalingo.core.domain

Examples of org.hoteia.qalingo.core.domain.CustomerGroup


        Criteria criteria = createDefaultCriteria(CustomerGroup.class);
       
        FetchPlan fetchPlan = handleSpecificCustomerGroupFetchMode(criteria, params);
       
        criteria.add(Restrictions.eq("id", customerGroupId));
        CustomerGroup customerGroup = (CustomerGroup) criteria.uniqueResult();
        if(customerGroup != null){
            customerGroup.setFetchPlan(fetchPlan);
        }
        return customerGroup;
  }
View Full Code Here


        Criteria criteria = createDefaultCriteria(CustomerGroup.class);
       
        FetchPlan fetchPlan = handleSpecificCustomerGroupFetchMode(criteria, params);
       
        criteria.add(Restrictions.eq("code", handleCodeValue(code)));
        CustomerGroup customerGroup = (CustomerGroup) criteria.uniqueResult();
        if(customerGroup != null){
            customerGroup.setFetchPlan(fetchPlan);
        }
        return customerGroup;
  }
View Full Code Here

    customerGroup.setDateUpdate(new Date());
        if (customerGroup.getId() != null) {
            if(em.contains(customerGroup)){
                em.refresh(customerGroup);
            }
            CustomerGroup mergedCustomerGroup = em.merge(customerGroup);
            em.flush();
            return mergedCustomerGroup;
        } else {
            em.persist(customerGroup);
            return customerGroup;
View Full Code Here

                customerViewBean.setDateUpdate(dateFormat.format(customer.getDateUpdate()));
            }

            final Set<CustomerGroup> groups = customer.getGroups();
            for (Iterator<CustomerGroup> iteratorGroup = groups.iterator(); iteratorGroup.hasNext();) {
                CustomerGroup group = (CustomerGroup) iteratorGroup.next();
                String keyCustomerGroup = group.getCode();
                String valueCustomerGroup = group.getName();
                customerViewBean.getGroups().put(keyCustomerGroup, valueCustomerGroup);

                final Set<CustomerRole> roles = group.getRoles();
                for (Iterator<CustomerRole> iteratorRole = roles.iterator(); iteratorRole.hasNext();) {
                    CustomerRole role = (CustomerRole) iteratorRole.next();
                    String keyCustomerRole = role.getCode();
                    String valueCustomerRole = role.getName();
                    customerViewBean.getRoles().put(keyCustomerRole, valueCustomerRole);
View Full Code Here

        customer.setDateUpdate(new Date());

        // WE SAVE A FIRST TIME TO EVICT DETACH ENTITY ISSUE WITH CUSTOMERGROUP - NOT THE BEST WAY
        Customer savedCustomer = customerService.saveOrUpdateCustomer(customer);
       
        CustomerGroup customerGroup = customerGroupService.getCustomerGroupByCode(CustomerGroup.GROUP_FO_CUSTOMER);
        customer.getGroups().add(customerGroup);
       
        savedCustomer = customerService.saveOrUpdateCustomer(customer);
       
        Customer reloadedCustomer = customerService.getCustomerById(savedCustomer.getId());
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.domain.CustomerGroup

Copyright © 2018 www.massapicom. 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.