Class CategoryServiceImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Category addChildCategory​(java.lang.String parentId, java.lang.String childId)
      This method does add child entity in parent entity.
      void addRelations​(Category categoryUI)
      This method creates all relationships between database entities.
      java.util.Optional<Category> createCategory​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> categoryAsMap)
      This method creates a database entity.
      CategoryRepository getRepository()  
      void prepareRelations​(Category categoryUI, Category categoryDB)
      This method does preparations of relationships between database entities.
      java.util.List<Category> rebuildAllCategories​(java.util.ArrayList<java.lang.Object> categories)
      This method rebuilds a list of database entities.
      void removeCategoriesByIds​(java.util.ArrayList<java.lang.String> categoriesIds)
      This method removes a list of database entities.
      void removeCategoryFromTranslation​(java.lang.String categoryId, java.lang.String translationId)
      This method removes relationship between database entities.
      void removeCategoryWithDescendants​(java.lang.String itemId)
      This method removes database entity with child database entity.
      void removeRelations​(Category categoryUI, Category categoryDB)
      This method removes all relationships between database entities.
      java.util.List<Category> searchCategories​(java.lang.String query, java.lang.String from, java.lang.String to)
      This method does search requests and returns data as list.
      Category updateCategory​(Category category)
      This method updates of database entity.
      Category updateCategory​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> categoryAsMap)
      This method updates of database entity.
      • Methods inherited from class java.lang.Object

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

      • CategoryServiceImpl

        public CategoryServiceImpl()
    • Method Detail

      • searchCategories

        public java.util.List<Category> searchCategories​(java.lang.String query,
                                                         java.lang.String from,
                                                         java.lang.String to)
        Description copied from interface: CategoryService
        This method does search requests and returns data as list.
        Specified by:
        searchCategories in interface CategoryService
        Parameters:
        query - search query
        from - field which filter and returned items
        to - field which filter and returned items
        Returns:
        database entities as list
      • createCategory

        @Transactional
        public java.util.Optional<Category> createCategory​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> categoryAsMap)
        Description copied from interface: CategoryService
        This method creates a database entity.
        Specified by:
        createCategory in interface CategoryService
        Parameters:
        categoryAsMap - map-representation of database entity
        Returns:
        optional value to externally interaction
      • addChildCategory

        @Transactional
        public Category addChildCategory​(java.lang.String parentId,
                                         java.lang.String childId)
        Description copied from interface: CategoryService
        This method does add child entity in parent entity.
        Specified by:
        addChildCategory in interface CategoryService
        Parameters:
        parentId - identification for database entity which will be updated
        childId - identification for database entity which will be added in parent database entity
        Returns:
        database entity
      • updateCategory

        @Transactional
        public Category updateCategory​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> categoryAsMap)
        Description copied from interface: CategoryService
        This method updates of database entity.
        Specified by:
        updateCategory in interface CategoryService
        Parameters:
        categoryAsMap - map-representation of database entity
        Returns:
        updated instance of database entity
      • updateCategory

        @Transactional
        public Category updateCategory​(Category category)
        Description copied from interface: CategoryService
        This method updates of database entity.
        Specified by:
        updateCategory in interface CategoryService
        Parameters:
        category - database entity which will be updated
        Returns:
        updated instance of database entity
      • prepareRelations

        @Transactional
        public void prepareRelations​(Category categoryUI,
                                     Category categoryDB)
        Description copied from interface: CategoryService
        This method does preparations of relationships between database entities.
        Specified by:
        prepareRelations in interface CategoryService
        Parameters:
        categoryUI - database entity
        categoryDB - target database entity
      • removeRelations

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

        @Transactional
        public void addRelations​(Category categoryUI)
        Description copied from interface: CategoryService
        This method creates all relationships between database entities.
        Specified by:
        addRelations in interface CategoryService
        Parameters:
        categoryUI - source database entity
      • removeCategoryFromTranslation

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

        @Transactional
        public void removeCategoryWithDescendants​(java.lang.String itemId)
        Description copied from interface: CategoryService
        This method removes database entity with child database entity.
        Specified by:
        removeCategoryWithDescendants in interface CategoryService
        Parameters:
        itemId - identification for child database entity which will be removed and whose parent entity will be removed
      • removeCategoriesByIds

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

        @Transactional
        public java.util.List<Category> rebuildAllCategories​(java.util.ArrayList<java.lang.Object> categories)
        Description copied from interface: CategoryService
        This method rebuilds a list of database entities.
        Specified by:
        rebuildAllCategories in interface CategoryService
        Parameters:
        categories - the list of database entities which will be removed and updated
        Returns:
        list of categories