Class CertificateServiceImpl

    • Constructor Detail

      • CertificateServiceImpl

        public CertificateServiceImpl()
    • Method Detail

      • searchResults

        public java.util.List<Certificate> searchResults​(java.lang.String requestJson)
        Description copied from interface: CertificateService
        This method does search requests and returns data as list.
        Specified by:
        searchResults in interface CertificateService
        Parameters:
        requestJson - search json
        Returns:
        database entities as list
      • searchResultsPaged

        public org.springframework.data.domain.Page<Certificate> searchResultsPaged​(java.lang.String requestJson)
        Description copied from interface: CertificateService
        This method does search requests and returns data as pages.
        Specified by:
        searchResultsPaged in interface CertificateService
        Parameters:
        requestJson - JSON-object of request contains an instructions for search queries
        Returns:
        database entities separated to pages
      • getPaginationFilter

        public java.util.Deque<java.util.Map<java.lang.String,​java.lang.Object>> getPaginationFilter​(java.lang.String requestJson)
        Description copied from interface: CertificateService
        This method does calculation for a pages based on the request.
        Specified by:
        getPaginationFilter in interface CertificateService
        Parameters:
        requestJson - JSON-object of request contains an instructions for search queries
        Returns:
        map-representation of data
      • isCertificateExists

        public boolean isCertificateExists​(java.lang.String certificateId)
        Description copied from interface: CertificateService
        This method checks is exists database entity.
        Specified by:
        isCertificateExists in interface CertificateService
        Parameters:
        certificateId - identification for database entity which will be checked
        Returns:
        value as boolean
      • isCertificateNotExists

        public boolean isCertificateNotExists​(java.lang.String certificateId)
        Description copied from interface: CertificateService
        This method checks is not exists database entity.
        Specified by:
        isCertificateNotExists in interface CertificateService
        Parameters:
        certificateId - identification for database entity which will be checked
        Returns:
        value as boolean
      • addCertificateToLoggedSeller

        @Transactional
        public void addCertificateToLoggedSeller​(java.lang.String certificateId)
        Description copied from interface: CertificateService
        This method does a relationship between entities.
        Specified by:
        addCertificateToLoggedSeller in interface CertificateService
        Parameters:
        certificateId - identification for database entity which will be updated
      • removeCertificateFromLoggedSeller

        public void removeCertificateFromLoggedSeller​(java.lang.String certificateId)
        Description copied from interface: CertificateService
        This method removes relationship between entities.
        Specified by:
        removeCertificateFromLoggedSeller in interface CertificateService
        Parameters:
        certificateId - identification for database entity which will be updated
      • createCertificate

        @Transactional
        public Certificate createCertificate​(java.util.LinkedHashMap<java.lang.String,​java.lang.Object> certificateAsMap)
        Description copied from interface: CertificateService
        This method creates a database entity.
        Specified by:
        createCertificate in interface CertificateService
        Parameters:
        certificateAsMap - map-representation of database entity
        Returns:
        database entity
      • saveCertificate

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

        @Transactional
        public void addCertificateToSeller​(java.lang.String certificateId,
                                           java.lang.String sellerId)
        Description copied from interface: CertificateService
        This method does a relationship between entities.
        Specified by:
        addCertificateToSeller in interface CertificateService
        Parameters:
        certificateId - identification for database entity which will be updated
        sellerId - identification for database entity which will be updated
      • linkToSeller

        private void linkToSeller​(java.lang.String certificateId,
                                  java.lang.String sellerId)
      • removeCertificateFromTranslations

        private void removeCertificateFromTranslations​(java.lang.String certificateId)
      • removeCertificateFromTranslation

        private void removeCertificateFromTranslation​(java.lang.String certificateId,
                                                      java.lang.String tranId)
      • addRelations

        private void addRelations​(Certificate certificate)
      • prepareRelations

        private void prepareRelations​(Certificate certificate)
      • removeCertificateFromSellers

        private void removeCertificateFromSellers​(java.lang.String certificateId)
      • removeCertificateFromSeller

        @Transactional
        public void removeCertificateFromSeller​(java.lang.String certificateId,
                                                java.lang.String sellerId)
        Description copied from interface: CertificateService
        This method removes relationship between database entities.
        Specified by:
        removeCertificateFromSeller in interface CertificateService
        Parameters:
        certificateId - identification for database entity which will be removed
        sellerId - identification for database entity which will be updated
      • unbindCertificateFromSeller

        private void unbindCertificateFromSeller​(java.lang.String certificateId,
                                                 java.lang.String sellerId)
      • removeCertificateAndClean

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

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

        public void addCertificatesByIds​(java.util.ArrayList<java.lang.String> certificatesIds,
                                         java.lang.String sellerId)
        Description copied from interface: CertificateService
        This method does a relationship between entities.
        Specified by:
        addCertificatesByIds in interface CertificateService
        Parameters:
        certificatesIds - the list of database entities which will be added
        sellerId - identification for database entity which will be updated
      • getSellerCertificates

        public java.util.List<Certificate> getSellerCertificates​(java.lang.String sellerId)
        Description copied from interface: CertificateService
        This method returns database entities as list.
        Specified by:
        getSellerCertificates in interface CertificateService
        Parameters:
        sellerId - identification for database entity which related entities list be returned
        Returns:
        database entities as list