Class DefaultProductInterestDao
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.dao.DefaultGenericDao<ProductInterestModel>
-
- de.hybris.platform.customerinterestsservices.productinterest.daos.impl.DefaultProductInterestDao
-
- All Implemented Interfaces:
ProductInterestDao,GenericDao<ProductInterestModel>
public class DefaultProductInterestDao extends DefaultGenericDao<ProductInterestModel> implements ProductInterestDao
-
-
Constructor Summary
Constructors Constructor Description DefaultProductInterestDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FlexibleSearchQuerybuildPagedProductInterestsQuery(CustomerModel customerModel, BaseStoreModel baseStore, BaseSiteModel baseSite, PageableData pageableData)protected FlexibleSearchQuerybuildProductInterestsQuery(CustomerModel customerModel, BaseStoreModel baseStore, BaseSiteModel baseSite)protected voidfillProductPKMap(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> productNotificationTypesMap, java.util.List<java.lang.String> productNotification)java.util.List<ProductInterestModel>findExpiredProductInterests()This method will get all the expired interestsjava.util.Optional<ProductInterestModel>findProductInterest(ProductModel productModel, CustomerModel customerModel, NotificationType notificationType, BaseStoreModel baseStore, BaseSiteModel baseSite)This method is used to find the ProductInterestModel by its productModel, customerModel, notificationType and baseStore.java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>findProductInterestRelationsByCustomer(CustomerModel customerModel, BaseStoreModel baseStore, BaseSiteModel baseSite)Find all interests watched by current customerjava.util.List<ProductInterestModel>findProductInterests(CustomerModel customerModel, BaseStoreModel baseStore, BaseSiteModel baseSite)This method is used to find expired and effective ProductInterestModels by its productModel, customerModel, notificationType and baseStore.java.util.List<ProductInterestModel>findProductInterestsByCustomer(CustomerModel customerModel, BaseStoreModel baseStore, BaseSiteModel baseSite)This method will get all the interests of the current customerjava.util.List<ProductInterestModel>findProductInterestsByNotificationType(NotificationType notificationType)retrieve such ProductInterests whose notification type is BACK_IN_STOCK and not expiredjava.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>findProductsByCustomerInterests(CustomerModel customerModel, BaseStoreModel baseStore, BaseSiteModel baseSite, PageableData pageableData)Find interests watched by current customerintfindProductsCountByCustomerInterests(CustomerModel customerModel, BaseStoreModel baseStore, BaseSiteModel baseSite, PageableData pageableData)Find the total count of products watched by customerprotected org.joda.time.DateTimeformatDate(java.lang.String expiryTime, java.text.SimpleDateFormat sdf)protected java.util.DategetExpiryDate()protected PagedFlexibleSearchServicegetPagedFlexibleSearchService()ProductInterestConfigServicegetProductInterestConfigService()voidsetPagedFlexibleSearchService(PagedFlexibleSearchService pagedFlexibleSearchService)voidsetProductInterestConfigService(ProductInterestConfigService productInterestConfigService)-
Methods inherited from class de.hybris.platform.servicelayer.internal.dao.DefaultGenericDao
find, find, find, find, find, getFlexibleSearchService, setFlexibleSearchService
-
-
-
-
Method Detail
-
findProductInterestsByCustomer
public java.util.List<ProductInterestModel> findProductInterestsByCustomer(CustomerModel customerModel, BaseStoreModel baseStore, BaseSiteModel baseSite)
Description copied from interface:ProductInterestDaoThis method will get all the interests of the current customer- Specified by:
findProductInterestsByCustomerin interfaceProductInterestDao- Parameters:
customerModel- the customer of which all the ProductInterests to be foundbaseStore- the baseStore of the ProductInterestbaseSite- 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:ProductInterestDaoThis method is used to find the ProductInterestModel by its productModel, customerModel, notificationType and baseStore.- Specified by:
findProductInterestin interfaceProductInterestDao- Parameters:
productModel- the product of the ProductInterestcustomerModel- the customer of the ProductInterestnotificationType- the notificationType of the ProductInterestbaseStore- the baseStore of the ProductInterestbaseSite- 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:ProductInterestDaoThis method is used to find expired and effective ProductInterestModels by its productModel, customerModel, notificationType and baseStore.- Specified by:
findProductInterestsin interfaceProductInterestDao- Parameters:
customerModel- the customer of the ProductInterestbaseStore- the baseStore of the ProductInterestbaseSite- the baseSite of the ProductInterest- Returns:
- ProductInterestModel if found and an empty Optional otherwise
-
findExpiredProductInterests
public java.util.List<ProductInterestModel> findExpiredProductInterests()
Description copied from interface:ProductInterestDaoThis method will get all the expired interests- Specified by:
findExpiredProductInterestsin interfaceProductInterestDao- Returns:
- all the expired ProductInterests
-
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:ProductInterestDaoFind interests watched by current customer- Specified by:
findProductsByCustomerInterestsin interfaceProductInterestDao- Parameters:
customerModel- the customer of the ProductInterestbaseStore- the baseStore of the ProductInterestbaseSite- the baseSite of the ProductInterestpageableData- 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:ProductInterestDaoFind all interests watched by current customer- Specified by:
findProductInterestRelationsByCustomerin interfaceProductInterestDao- Parameters:
customerModel- the customer of the ProductInterestbaseStore- the baseStore of the ProductInterestbaseSite- 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:ProductInterestDaoFind the total count of products watched by customer- Specified by:
findProductsCountByCustomerInterestsin interfaceProductInterestDao- Parameters:
customerModel- the customer of the ProductInterestbaseStore- the baseStore of the ProductInterestbaseSite- the baseSite of the ProductInterestpageableData- the pagination data- Returns:
- the total count of products watched by customer
-
findProductInterestsByNotificationType
public java.util.List<ProductInterestModel> findProductInterestsByNotificationType(NotificationType notificationType)
Description copied from interface:ProductInterestDaoretrieve such ProductInterests whose notification type is BACK_IN_STOCK and not expired- Specified by:
findProductInterestsByNotificationTypein interfaceProductInterestDao- Returns:
- The list of ProductInterests to send BACK_IN_STOCK notification
-
buildPagedProductInterestsQuery
protected FlexibleSearchQuery buildPagedProductInterestsQuery(CustomerModel customerModel, BaseStoreModel baseStore, BaseSiteModel baseSite, PageableData pageableData)
-
buildProductInterestsQuery
protected FlexibleSearchQuery buildProductInterestsQuery(CustomerModel customerModel, BaseStoreModel baseStore, BaseSiteModel baseSite)
-
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)
-
getPagedFlexibleSearchService
protected PagedFlexibleSearchService getPagedFlexibleSearchService()
-
setPagedFlexibleSearchService
public void setPagedFlexibleSearchService(PagedFlexibleSearchService pagedFlexibleSearchService)
-
setProductInterestConfigService
public void setProductInterestConfigService(ProductInterestConfigService productInterestConfigService)
-
getProductInterestConfigService
public ProductInterestConfigService getProductInterestConfigService()
-
-