Class DefaultProductInterestDao

    • Constructor Detail

      • DefaultProductInterestDao

        public DefaultProductInterestDao()
    • Method Detail

      • findProductInterestsByCustomer

        public java.util.List<ProductInterestModel> findProductInterestsByCustomer​(CustomerModel customerModel,
                                                                                   BaseStoreModel baseStore,
                                                                                   BaseSiteModel baseSite)
        Description copied from interface: ProductInterestDao
        This method will get all the interests of the current customer
        Specified by:
        findProductInterestsByCustomer in interface ProductInterestDao
        Parameters:
        customerModel - the customer of which all the ProductInterests to be found
        baseStore - the baseStore of the ProductInterest
        baseSite - the baseSite of the ProductInterest
        Returns:
        all the ProductInterests of the current customer
      • findProductInterest

        public java.util.Optional<ProductInterestModel> findProductInterest​(ProductModel productModel,
                                                                            CustomerModel customerModel,
                                                                            NotificationType notificationType,
                                                                            BaseStoreModel baseStore,
                                                                            BaseSiteModel baseSite)
        Description copied from interface: ProductInterestDao
        This method is used to find the ProductInterestModel by its productModel, customerModel, notificationType and baseStore.
        Specified by:
        findProductInterest in interface ProductInterestDao
        Parameters:
        productModel - the product of the ProductInterest
        customerModel - the customer of the ProductInterest
        notificationType - the notificationType of the ProductInterest
        baseStore - the baseStore of the ProductInterest
        baseSite - the baseSite of the ProductInterest
        Returns:
        ProductInterestModel if found and an empty Optional otherwise
      • findProductInterests

        public java.util.List<ProductInterestModel> findProductInterests​(CustomerModel customerModel,
                                                                         BaseStoreModel baseStore,
                                                                         BaseSiteModel baseSite)
        Description copied from interface: ProductInterestDao
        This method is used to find expired and effective ProductInterestModels by its productModel, customerModel, notificationType and baseStore.
        Specified by:
        findProductInterests in interface ProductInterestDao
        Parameters:
        customerModel - the customer of the ProductInterest
        baseStore - the baseStore of the ProductInterest
        baseSite - the baseSite of the ProductInterest
        Returns:
        ProductInterestModel if found and an empty Optional otherwise
      • getExpiryDate

        protected java.util.Date getExpiryDate()
      • findProductsByCustomerInterests

        public java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> findProductsByCustomerInterests​(CustomerModel customerModel,
                                                                                                                                            BaseStoreModel baseStore,
                                                                                                                                            BaseSiteModel baseSite,
                                                                                                                                            PageableData pageableData)
        Description copied from interface: ProductInterestDao
        Find interests watched by current customer
        Specified by:
        findProductsByCustomerInterests in interface ProductInterestDao
        Parameters:
        customerModel - the customer of the ProductInterest
        baseStore - the baseStore of the ProductInterest
        baseSite - the baseSite of the ProductInterest
        pageableData - the pagination data
        Returns:
        Map whose key is Product PK and value is the Map of NotificationType PK as key and creation time as value.
      • findProductInterestRelationsByCustomer

        public java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> findProductInterestRelationsByCustomer​(CustomerModel customerModel,
                                                                                                                                                   BaseStoreModel baseStore,
                                                                                                                                                   BaseSiteModel baseSite)
        Description copied from interface: ProductInterestDao
        Find all interests watched by current customer
        Specified by:
        findProductInterestRelationsByCustomer in interface ProductInterestDao
        Parameters:
        customerModel - the customer of the ProductInterest
        baseStore - the baseStore of the ProductInterest
        baseSite - the baseSite of the ProductInterest
        Returns:
        Map whose key is Product PK and value is the Map of NotificationType PK as key and creation time as value.
      • findProductsCountByCustomerInterests

        public int findProductsCountByCustomerInterests​(CustomerModel customerModel,
                                                        BaseStoreModel baseStore,
                                                        BaseSiteModel baseSite,
                                                        PageableData pageableData)
        Description copied from interface: ProductInterestDao
        Find the total count of products watched by customer
        Specified by:
        findProductsCountByCustomerInterests in interface ProductInterestDao
        Parameters:
        customerModel - the customer of the ProductInterest
        baseStore - the baseStore of the ProductInterest
        baseSite - the baseSite of the ProductInterest
        pageableData - the pagination data
        Returns:
        the total count of products watched by customer
      • fillProductPKMap

        protected void fillProductPKMap​(java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> productNotificationTypesMap,
                                        java.util.List<java.lang.String> productNotification)
      • formatDate

        protected org.joda.time.DateTime formatDate​(java.lang.String expiryTime,
                                                    java.text.SimpleDateFormat sdf)
      • setPagedFlexibleSearchService

        public void setPagedFlexibleSearchService​(PagedFlexibleSearchService pagedFlexibleSearchService)
      • setProductInterestConfigService

        public void setProductInterestConfigService​(ProductInterestConfigService productInterestConfigService)