Class DefaultCommerceQuoteDao
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.dao.DefaultGenericDao<QuoteModel>
-
- de.hybris.platform.commerceservices.order.dao.impl.DefaultCommerceQuoteDao
-
- All Implemented Interfaces:
CommerceQuoteDao
,GenericDao<QuoteModel>
public class DefaultCommerceQuoteDao extends DefaultGenericDao<QuoteModel> implements CommerceQuoteDao
Default implementation ofCommerceQuoteDao
interface extendingDefaultGenericDao
-
-
Constructor Summary
Constructors Constructor Description DefaultCommerceQuoteDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
createQuery(java.lang.String... queryClauses)
protected SortQueryData
createSortQueryData(java.lang.String sortCode, java.lang.String query)
SearchPageData<QuoteModel>
findQuotesByCustomerAndStore(CustomerModel customerModel, BaseStoreModel store, PageableData pageableData, java.util.Set<QuoteState> quoteStates)
Returns a paged list of maximum version (i.e.SearchResult<QuoteModel>
findQuotesExpired(java.util.Date currentDate, QuoteNotificationType notificationType, java.util.Set<QuoteState> quoteStates)
Returns a list of active (last version) quotes filtered by given statuses which are expiredSearchResult<QuoteModel>
findQuotesSoonToExpire(java.util.Date expiredAfter, java.util.Date expiredBy, QuoteNotificationType notificationType, java.util.Set<QuoteState> quoteStates)
Returns a list of active (last version) quotes filtered by given statuses which will expire by the specified dateQuoteModel
findUniqueQuoteByCodeAndCustomerAndStore(CustomerModel customerModel, BaseStoreModel store, java.lang.String quoteCode, java.util.Set<QuoteState> quoteStates)
Returns a unique quote of maximum version (i.e.protected PagedFlexibleSearchService
getPagedFlexibleSearchService()
java.lang.Integer
getQuotesCountForCustomerAndStore(CustomerModel customerModel, BaseStoreModel store, java.util.Set<QuoteState> quoteStates)
Returns the total number of quotes for the specified user and store.protected java.util.Map<java.lang.String,java.lang.Object>
populateBasicQueryParams(BaseStoreModel store, CustomerModel customerModel, java.util.Set<QuoteState> quoteStates)
void
setPagedFlexibleSearchService(PagedFlexibleSearchService pagedFlexibleSearchService)
protected void
validateQuoteStateList(java.util.Set<QuoteState> quoteStates, java.lang.String msg)
protected void
validateUserAndStoreAndStates(BaseStoreModel store, CustomerModel customerModel, java.util.Set<QuoteState> quoteStates)
-
Methods inherited from class de.hybris.platform.servicelayer.internal.dao.DefaultGenericDao
find, find, find, find, find, getFlexibleSearchService, setFlexibleSearchService
-
-
-
-
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 interfaceCommerceQuoteDao
- Parameters:
customerModel
- the customer to retrieve quotes forstore
- the store to retrieve quotes forpageableData
- the pagination settingsquoteStates
- 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 interfaceCommerceQuoteDao
- Parameters:
expiredAfter
- the date after which the quote is going to expireexpiredBy
- the date before which the quote is going to expirenotificationType
- 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 interfaceCommerceQuoteDao
- Parameters:
currentDate
- the current datenotificationType
- 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 interfaceCommerceQuoteDao
- Parameters:
customerModel
- the customer to retrieve quotes forstore
- the store to retrieve quotes forquoteCode
- the quote code to search forquoteStates
- 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 interfaceCommerceQuoteDao
- Parameters:
customerModel
- the customer to get the quote count forstore
- the store to get the quote count forquoteStates
- 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)
-
validateUserAndStoreAndStates
protected void validateUserAndStoreAndStates(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)
-
getPagedFlexibleSearchService
protected PagedFlexibleSearchService getPagedFlexibleSearchService()
-
setPagedFlexibleSearchService
public void setPagedFlexibleSearchService(PagedFlexibleSearchService pagedFlexibleSearchService)
-
-