Class ProductServiceImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Product addProductToCategory​(java.lang.String categoryId, java.util.LinkedHashMap<java.lang.String,​java.lang.Object> productAsMap)
      This method does a relationship between entities.
      void addRelations​(Product productUI)
      This method creates all relationships between database entities.
      java.util.Optional<Product> createProduct​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> productAsMap)
      This method creates a database entity.
      java.util.HashSet<EmbeddedBean> getFallIntoProducts​(java.lang.String[] productIds)
      This method returns data as set.
      java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getProductsByCategoryAndFirstLetter​(java.lang.String categoryId, java.lang.String firstLetter)
      This method retrieves a map, which can be processed in a templates.
      ProductRepository getRepository()  
      java.util.List<java.util.Map<java.lang.String,​java.lang.String>> getSortedProductsByCategory​(java.lang.String categoryId)
      This method retrieves a map, which can be processed in a templates.
      void prepareRelations​(Product productUI)
      This method does preparations of relationships between database entities.
      void removeProductAndClean​(java.lang.String productId)
      This method removes a database entity and clean all relationships from another entities.
      void removeProductFromAttribute​(java.lang.String productId, java.lang.String attrId)
      This method removes relationship between database entities.
      void removeProductFromAttributes​(java.lang.String productId)
      This method removes relationship between database entities.
      void removeProductFromCategories​(java.lang.String productId)
      This method removes relationship between database entities.
      void removeProductFromCategory​(java.lang.String productId, java.lang.String categoryId)
      This method removes relationship between database entities.
      void removeProductFromSKU​(java.lang.String productId, java.lang.String skuId)
      This method removes relationship between database entities.
      void removeProductFromSKUs​(java.lang.String productId)
      This method removes relationship between database entities.
      void removeProductFromTranslation​(java.lang.String productId, java.lang.String tranId)
      This method removes relationship between database entities.
      void removeProductFromTranslations​(java.lang.String productId)
      This method removes relationship between database entities.
      void removeProductsByIds​(java.util.ArrayList<java.lang.String> productsIds)
      This method removes a list of database entities.
      void removeRelations​(Product productUI, Product productDB)
      This method removes all relationships between database entities.
      Product saveProduct​(Product product)
      This method saves a database entity.
      Product saveProduct​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> productAsMap)
      This method save an updates of database entity.
      java.util.List<Product> searchProducts​(java.lang.String query, java.lang.String offset, java.lang.String limit)
      This method does search requests and returns data as list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProductServiceImpl

        public ProductServiceImpl()
    • Method Detail

      • searchProducts

        public java.util.List<Product> searchProducts​(java.lang.String query,
                                                      java.lang.String offset,
                                                      java.lang.String limit)
        Description copied from interface: ProductService
        This method does search requests and returns data as list.
        Specified by:
        searchProducts in interface ProductService
        Parameters:
        query - search query
        offset - offset for returned items
        limit - limit for returned items
        Returns:
        database entities as list
      • createProduct

        @Transactional
        public java.util.Optional<Product> createProduct​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> productAsMap)
        Description copied from interface: ProductService
        This method creates a database entity.
        Specified by:
        createProduct in interface ProductService
        Parameters:
        productAsMap - map-representation of database entity
        Returns:
        database entity
      • addProductToCategory

        @Transactional
        public Product addProductToCategory​(java.lang.String categoryId,
                                            java.util.LinkedHashMap<java.lang.String,​java.lang.Object> productAsMap)
        Description copied from interface: ProductService
        This method does a relationship between entities.
        Specified by:
        addProductToCategory in interface ProductService
        Parameters:
        categoryId - identification for database entity which will be updated
        productAsMap - map-representation of database entity
        Returns:
        database entity
      • saveProduct

        @Transactional
        public Product saveProduct​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> productAsMap)
        Description copied from interface: ProductService
        This method save an updates of database entity.
        Specified by:
        saveProduct in interface ProductService
        Parameters:
        productAsMap - map-representation of database entity
        Returns:
        saved instance of database entity
      • saveProduct

        @Transactional
        public Product saveProduct​(Product product)
        Description copied from interface: ProductService
        This method saves a database entity.
        Specified by:
        saveProduct in interface ProductService
        Parameters:
        product - database entity
        Returns:
        saved instance of database entity
      • prepareRelations

        @Transactional
        public void prepareRelations​(Product productUI)
        Description copied from interface: ProductService
        This method does preparations of relationships between database entities.
        Specified by:
        prepareRelations in interface ProductService
        Parameters:
        productUI - database entity
      • getSortedProductsByCategory

        @Transactional
        public java.util.List<java.util.Map<java.lang.String,​java.lang.String>> getSortedProductsByCategory​(java.lang.String categoryId)
        Description copied from interface: ProductService
        This method retrieves a map, which can be processed in a templates.
        Specified by:
        getSortedProductsByCategory in interface ProductService
        Parameters:
        categoryId - identification for database entity which will be retrieved
        Returns:
        map-representation of data
      • getProductsByCategoryAndFirstLetter

        public java.util.List<java.util.Map<java.lang.String,​java.lang.Object>> getProductsByCategoryAndFirstLetter​(java.lang.String categoryId,
                                                                                                                          java.lang.String firstLetter)
        Description copied from interface: ProductService
        This method retrieves a map, which can be processed in a templates.
        Specified by:
        getProductsByCategoryAndFirstLetter in interface ProductService
        Parameters:
        categoryId - identification for database entity which will be retrieved
        firstLetter - first letter of the name for the product
        Returns:
        map-representation of data
      • removeRelations

        @Transactional
        public void removeRelations​(Product productUI,
                                    Product productDB)
        Description copied from interface: ProductService
        This method removes all relationships between database entities.
        Specified by:
        removeRelations in interface ProductService
        Parameters:
        productUI - source database entity
        productDB - target database entity
      • addRelations

        @Transactional
        public void addRelations​(Product productUI)
        Description copied from interface: ProductService
        This method creates all relationships between database entities.
        Specified by:
        addRelations in interface ProductService
        Parameters:
        productUI - source database entity
      • removeProductFromCategory

        @Transactional
        public void removeProductFromCategory​(java.lang.String productId,
                                              java.lang.String categoryId)
        Description copied from interface: ProductService
        This method removes relationship between database entities.
        Specified by:
        removeProductFromCategory in interface ProductService
        Parameters:
        productId - identification for database entity which will be removed
        categoryId - identification for database entity which will be updated
      • removeProductFromSKU

        @Transactional
        public void removeProductFromSKU​(java.lang.String productId,
                                         java.lang.String skuId)
        Description copied from interface: ProductService
        This method removes relationship between database entities.
        Specified by:
        removeProductFromSKU in interface ProductService
        Parameters:
        productId - identification for database entity which will be removed
        skuId - identification for database entity which will be updated
      • removeProductFromAttribute

        @Transactional
        public void removeProductFromAttribute​(java.lang.String productId,
                                               java.lang.String attrId)
        Description copied from interface: ProductService
        This method removes relationship between database entities.
        Specified by:
        removeProductFromAttribute in interface ProductService
        Parameters:
        productId - identification for database entity which will be removed
        attrId - identification for database entity which will be updated
      • removeProductFromTranslation

        @Transactional
        public void removeProductFromTranslation​(java.lang.String productId,
                                                 java.lang.String tranId)
        Description copied from interface: ProductService
        This method removes relationship between database entities.
        Specified by:
        removeProductFromTranslation in interface ProductService
        Parameters:
        productId - identification for database entity which will be removed
        tranId - identification for database entity which will be updated
      • removeProductFromCategories

        @Transactional
        public void removeProductFromCategories​(java.lang.String productId)
        Description copied from interface: ProductService
        This method removes relationship between database entities.
        Specified by:
        removeProductFromCategories in interface ProductService
        Parameters:
        productId - identification for database entity which will be removed
      • removeProductFromSKUs

        @Transactional
        public void removeProductFromSKUs​(java.lang.String productId)
        Description copied from interface: ProductService
        This method removes relationship between database entities.
        Specified by:
        removeProductFromSKUs in interface ProductService
        Parameters:
        productId - identification for database entity which will be removed
      • removeProductFromAttributes

        @Transactional
        public void removeProductFromAttributes​(java.lang.String productId)
        Description copied from interface: ProductService
        This method removes relationship between database entities.
        Specified by:
        removeProductFromAttributes in interface ProductService
        Parameters:
        productId - identification for database entity which will be removed
      • removeProductFromTranslations

        @Transactional
        public void removeProductFromTranslations​(java.lang.String productId)
        Description copied from interface: ProductService
        This method removes relationship between database entities.
        Specified by:
        removeProductFromTranslations in interface ProductService
        Parameters:
        productId - identification for database entity which will be removed
      • removeProductAndClean

        @Transactional
        public void removeProductAndClean​(java.lang.String productId)
        Description copied from interface: ProductService
        This method removes a database entity and clean all relationships from another entities.
        Specified by:
        removeProductAndClean in interface ProductService
        Parameters:
        productId - identification for database entity which will be removed
      • removeProductsByIds

        @Transactional
        public void removeProductsByIds​(java.util.ArrayList<java.lang.String> productsIds)
        Description copied from interface: ProductService
        This method removes a list of database entities.
        Specified by:
        removeProductsByIds in interface ProductService
        Parameters:
        productsIds - the list of database entities which will be removed
      • getFallIntoProducts

        @Transactional
        public java.util.HashSet<EmbeddedBean> getFallIntoProducts​(java.lang.String[] productIds)
        Description copied from interface: ProductService
        This method returns data as set.
        Specified by:
        getFallIntoProducts in interface ProductService
        Parameters:
        productIds - the list of database entities which will be retrieved
        Returns:
        database entities as list