Package org.hoteia.qalingo.core.domain

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


        logger.debug("Found {} catalogs", allCatalogMasters.size());
        return PojoUtil.mapAll(dozerBeanMapper, allCatalogMasters, CatalogPojo.class);
    }

    public CatalogPojo getMasterCatalogByCode(final String catalogCode) {
        final CatalogMaster catalog = catalogService.getMasterCatalogById(catalogCode);
        logger.debug("Found catalog {} for catalogCode {}", catalog, catalogCode);
        return buildMasterCatalog(catalog);
    }
View Full Code Here


        FetchPlan fetchPlan = handleSpecificFetchMode(criteria, params);
       
        criteria.add(Restrictions.eq("id", masterCatalogId));
       
        CatalogMaster catalogMaster = (CatalogMaster) criteria.uniqueResult();
        if(catalogMaster != null){
            catalogMaster.setFetchPlan(fetchPlan);
        }
        return catalogMaster;
  }
View Full Code Here

       
        FetchPlan fetchPlan = handleSpecificFetchMode(criteria, params);

        criteria.add(Restrictions.eq("code", handleCodeValue(masterCatalogCode)));

        CatalogMaster catalog = (CatalogMaster) criteria.uniqueResult();
        if(catalog != null){
            catalog.setFetchPlan(fetchPlan);
        }
        return catalog;
    }
View Full Code Here

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

        final MarketArea currentMarketArea = requestData.getMarketArea();
        final String catalogType = request.getParameter(RequestConstants.REQUEST_PARAMETER_CATALOG_TYPE);

        CatalogPojo catalogPojo = new CatalogPojo();
        if("master".equals(catalogType)){
            final CatalogMaster catalogMaster = catalogService.getMasterCatalogById(currentMarketArea.getCatalog().getCatalogMaster().getId());

            Set<CatalogCategoryMaster> catalogCategories = new HashSet<CatalogCategoryMaster>();
            if(catalogMaster.getCatalogCategories() != null){
                for (Iterator<CatalogCategoryMaster> iterator = catalogMaster.getCatalogCategories().iterator(); iterator.hasNext();) {
                    CatalogCategoryMaster categoryMaster = (CatalogCategoryMaster) iterator.next();
                    CatalogCategoryMaster reloadedCategoryMaster = catalogCategoryService.getMasterCatalogCategoryById(categoryMaster.getId(), new FetchPlan(categoryMasterFetchPlans));
                    Set<CatalogCategoryMaster> reloadedSubCategories = new HashSet<CatalogCategoryMaster>();
                    if(reloadedCategoryMaster.getSortedChildCatalogCategories() != null){
                        for (Iterator<CatalogCategoryMaster> iteratorSubCategories = reloadedCategoryMaster.getSortedChildCatalogCategories().iterator(); iteratorSubCategories.hasNext();) {
                            CatalogCategoryMaster subCategory = (CatalogCategoryMaster) iteratorSubCategories.next();
                            CatalogCategoryMaster reloadedSubCategory = catalogCategoryService.getMasterCatalogCategoryById(subCategory.getId(), new FetchPlan(categoryMasterFetchPlans));
                            reloadedSubCategories.add(reloadedSubCategory);
                        }
                    }
                    reloadedCategoryMaster.setCatalogCategories(reloadedSubCategories);
                    catalogCategories.add(reloadedCategoryMaster);
                }
            }
            catalogMaster.setCatalogCategories(new HashSet<CatalogCategoryMaster>(catalogCategories));
           
            try {
                catalogPojo = (CatalogPojo) catalogPojoService.buildMasterCatalog(catalogMaster);
            } catch (Exception e) {
                logger.error("", e);
View Full Code Here

TOP

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

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.