Package org.hoteia.qalingo.core.domain

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


    private final Logger logger = LoggerFactory.getLogger(getClass());

    public CustomerWishlist getCustomerWishlistById(final Long customerWishlistId, Object... params) {
        Criteria criteria = createDefaultCriteria(CustomerWishlist.class);
        criteria.add(Restrictions.eq("id", customerWishlistId));
        CustomerWishlist customerWishlist = (CustomerWishlist) criteria.uniqueResult();
        return customerWishlist;
    }
View Full Code Here


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

        final CustomerMarketArea customerMarketArea = customer.getCurrentCustomerMarketArea(marketArea.getId());
        if (customerMarketArea != null) {
            final Set<CustomerWishlist> customerWishlists = customerMarketArea.getWishlistProducts();
            if (Hibernate.isInitialized(customerWishlists) && customerWishlists != null) {
                for (Iterator<CustomerWishlist> iterator = customerWishlists.iterator(); iterator.hasNext();) {
                    final CustomerWishlist customerWishlist = (CustomerWishlist) iterator.next();
                    final ProductSku productSku = productService.getProductSkuByCode(customerWishlist.getProductSkuCode());
                    final ProductMarketing productMarketing =  productService.getProductMarketingByCode(productSku.getProductMarketing().getCode());
                    final CatalogCategoryVirtual catalogCategory = catalogCategoryService.getDefaultVirtualCatalogCategoryByProductSkuId(productSku.getId());
                    customerWishlistViewBean.getProductSkus().add(buildViewBeanProductSku(requestData, catalogCategory, productMarketing, productSku));
                }
            }
View Full Code Here

        return customerDao.findCustomers(params);
    }

    public Customer addProductSkuToWishlist(final MarketArea marketArea, Customer customer, final String catalogCategoryCode, final String productSkuCode) throws Exception {
        final CustomerMarketArea customerMarketArea = customer.getCurrentCustomerMarketArea(marketArea.getId());
        CustomerWishlist customerWishlist = customerMarketArea.getCustomerWishlistByProductSkuCode(productSkuCode);
        if(customerWishlist == null){
            customerWishlist = new CustomerWishlist();
            customerWishlist.setCustomerMarketAreaId(customerMarketArea.getId());
            customerWishlist.setCatalogCategoryCode(catalogCategoryCode);
            customerWishlist.setProductSkuCode(productSkuCode);
            customerWishlist.setPosition(customerMarketArea.getWishlistProducts().size() + 1);
            customerMarketArea.getWishlistProducts().add(customerWishlist);
            customer.getCustomerMarketAreas().add(customerMarketArea);
            customer = saveOrUpdateCustomer(customer);
           
        } else {
View Full Code Here

        return customer;
    }
   
    public Customer removeProductSkuFromWishlist(final MarketArea marketArea, Customer customer, final String productSkuCode) throws Exception {
        final CustomerMarketArea customerMarketArea = customer.getCurrentCustomerMarketArea(marketArea.getId());
        CustomerWishlist customerWishlist = customerMarketArea.getCustomerWishlistByProductSkuCode(productSkuCode);
        if(customerWishlist != null){
            customerMarketArea.getWishlistProducts().remove(customerWishlist);
            customer.getCustomerMarketAreas().add(customerMarketArea);
            customer = saveOrUpdateCustomer(customer);
        }
View Full Code Here

TOP

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

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.