Class DefaultCommerceQuoteDao

    • Constructor Detail

      • DefaultCommerceQuoteDao

        public DefaultCommerceQuoteDao()
    • Method Detail

      • findQuotesByCustomerAndStore

        public SearchPageData<QuoteModel> findQuotesByCustomerAndStore​(CustomerModel customerModel,
                                                                       BaseStoreModel store,
                                                                       PageableData pageableData,
                                                                       java.util.Set<QuoteState> quoteStates)
        Description copied from interface: CommerceQuoteDao
        Returns a paged list of maximum version (i.e. active quotes) of each quote for the specified user & store, filtered by accessible quote states.
        Specified by:
        findQuotesByCustomerAndStore in interface CommerceQuoteDao
        Parameters:
        customerModel - the customer to retrieve quotes for
        store - the store to retrieve quotes for
        pageableData - the pagination settings
        quoteStates - the quote states the user can access
        Returns:
        the paged search result
      • findQuotesSoonToExpire

        public SearchResult<QuoteModel> findQuotesSoonToExpire​(java.util.Date expiredAfter,
                                                               java.util.Date expiredBy,
                                                               QuoteNotificationType notificationType,
                                                               java.util.Set<QuoteState> quoteStates)
        Description copied from interface: CommerceQuoteDao
        Returns a list of active (last version) quotes filtered by given statuses which will expire by the specified date
        Specified by:
        findQuotesSoonToExpire in interface CommerceQuoteDao
        Parameters:
        expiredAfter - the date after which the quote is going to expire
        expiredBy - the date before which the quote is going to expire
        notificationType - the quote notification, for which we are getting quotes (quotes which have this notification set will be excluded from the results)
        quoteStates - the quote states the user can access
        Returns:
        the paged search result
      • findQuotesExpired

        public SearchResult<QuoteModel> findQuotesExpired​(java.util.Date currentDate,
                                                          QuoteNotificationType notificationType,
                                                          java.util.Set<QuoteState> quoteStates)
        Description copied from interface: CommerceQuoteDao
        Returns a list of active (last version) quotes filtered by given statuses which are expired
        Specified by:
        findQuotesExpired in interface CommerceQuoteDao
        Parameters:
        currentDate - the current date
        notificationType - the quote notification, for which we are getting quotes (quotes which have this notification set will be excluded from the results)
        quoteStates - the quote states the user can access
        Returns:
        the paged search result
      • findUniqueQuoteByCodeAndCustomerAndStore

        public QuoteModel findUniqueQuoteByCodeAndCustomerAndStore​(CustomerModel customerModel,
                                                                   BaseStoreModel store,
                                                                   java.lang.String quoteCode,
                                                                   java.util.Set<QuoteState> quoteStates)
        Description copied from interface: CommerceQuoteDao
        Returns a unique quote of maximum version (i.e. active quote) for the specified user, store & code, filtered by accessible quote states.
        Specified by:
        findUniqueQuoteByCodeAndCustomerAndStore in interface CommerceQuoteDao
        Parameters:
        customerModel - the customer to retrieve quotes for
        store - the store to retrieve quotes for
        quoteCode - the quote code to search for
        quoteStates - the quote states the user can access
        Returns:
        the unique quote matching the search parameters
      • getQuotesCountForCustomerAndStore

        public java.lang.Integer getQuotesCountForCustomerAndStore​(CustomerModel customerModel,
                                                                   BaseStoreModel store,
                                                                   java.util.Set<QuoteState> quoteStates)
        Description copied from interface: CommerceQuoteDao
        Returns the total number of quotes for the specified user and store.
        Specified by:
        getQuotesCountForCustomerAndStore in interface CommerceQuoteDao
        Parameters:
        customerModel - the customer to get the quote count for
        store - the store to get the quote count for
        quoteStates - the list of states the user can access
        Returns:
        the quote count
      • populateBasicQueryParams

        protected java.util.Map<java.lang.String,​java.lang.Object> populateBasicQueryParams​(BaseStoreModel store,
                                                                                                  CustomerModel customerModel,
                                                                                                  java.util.Set<QuoteState> quoteStates)
      • validateQuoteStateList

        protected void validateQuoteStateList​(java.util.Set<QuoteState> quoteStates,
                                              java.lang.String msg)
      • createSortQueryData

        protected SortQueryData createSortQueryData​(java.lang.String sortCode,
                                                    java.lang.String query)
      • createQuery

        protected java.lang.String createQuery​(java.lang.String... queryClauses)
      • setPagedFlexibleSearchService

        public void setPagedFlexibleSearchService​(PagedFlexibleSearchService pagedFlexibleSearchService)