Class DefaultPromotionalCategoryProductService<P extends PromotionalCategoryProduct>

java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.catalog.service.DefaultPromotionalCategoryProductService<P>
All Implemented Interfaces:
PromotionalCategoryProductService<P>, com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>

public class DefaultPromotionalCategoryProductService<P extends PromotionalCategoryProduct> extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P> implements PromotionalCategoryProductService<P>
Author:
Samarth Dhruva (samarthd)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultPromotionalCategoryProductService(PromotionalCategoryProductRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected com.broadleafcommerce.common.extension.cache.key.ContextKeyGen
     
    protected com.broadleafcommerce.common.extension.cache.CacheStateManager
     
    protected PromotionalCategoryProductRepository<com.broadleafcommerce.data.tracking.core.Trackable>
     
     
    org.springframework.data.domain.Page<P>
    readByCategoryContextIdAndType(String categoryContextId, String type, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Reads all of the category promotional products in the database associated with the given category context ID, optionally filtered by the relationship type.
    readByCategoryId(@NonNull String categoryId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Reads all of the PromotionalCategoryProduct relationships in the database associated with the given category context ID.
    readByJoinedIds(String productId, String categoryId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Query for a PromotionalCategoryProduct that joins a given product and category.
    void
    setCacheByPromotionalProductKeyGen(com.broadleafcommerce.common.extension.cache.key.ContextKeyGen cacheByPromotionalProductKeyGen)
     

    Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService

    getRsqlHelper, readAll, readAll, readAll, readAll

    Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService

    convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService

    create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService

    readAll, readAll, readAll, readAll
  • Field Details

  • Constructor Details

    • DefaultPromotionalCategoryProductService

      public DefaultPromotionalCategoryProductService(PromotionalCategoryProductRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, @Nullable com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager)
  • Method Details

    • readByCategoryContextIdAndType

      @NonNull public org.springframework.data.domain.Page<P> readByCategoryContextIdAndType(@NonNull String categoryContextId, @Nullable String type, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: PromotionalCategoryProductService
      Reads all of the category promotional products in the database associated with the given category context ID, optionally filtered by the relationship type.
      Specified by:
      readByCategoryContextIdAndType in interface PromotionalCategoryProductService<P extends PromotionalCategoryProduct>
      Parameters:
      categoryContextId - the category context ID to find the relations for
      type - the type of promotion to filter by (optional)
      page - the requested page of results from the database
      contextInfo - the context to query within
      Returns:
      the category promotional products in the database that match the given category context ID
    • readByJoinedIds

      public Optional<P> readByJoinedIds(String productId, String categoryId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: PromotionalCategoryProductService
      Query for a PromotionalCategoryProduct that joins a given product and category.
      Specified by:
      readByJoinedIds in interface PromotionalCategoryProductService<P extends PromotionalCategoryProduct>
      Parameters:
      productId - the product context ID
      categoryId - the category context ID
      contextInfo - context surrounding sandboxing and multitenant state
      Returns:
      an Optional that is either empty or contains the PromotionalCategoryProduct that was found
    • readByCategoryId

      @NonNull public List<P> readByCategoryId(@NonNull @NonNull @NonNull String categoryId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: PromotionalCategoryProductService
      Reads all of the PromotionalCategoryProduct relationships in the database associated with the given category context ID.
      Specified by:
      readByCategoryId in interface PromotionalCategoryProductService<P extends PromotionalCategoryProduct>
      Parameters:
      categoryId - the category context ID to find the relationships for
      contextInfo - the context to query within
      Returns:
      the PromotionalCategoryProduct relationships in the database that match the given category context ID
    • getRepositoryDomain

      public String getRepositoryDomain()
      Specified by:
      getRepositoryDomain in interface PromotionalCategoryProductService<P extends PromotionalCategoryProduct>
    • getRepository

      @NonNull protected PromotionalCategoryProductRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()
      Overrides:
      getRepository in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends PromotionalCategoryProduct>
    • getCacheStateManager

      @Nullable protected com.broadleafcommerce.common.extension.cache.CacheStateManager getCacheStateManager()
    • setCacheByPromotionalProductKeyGen

      @Autowired @Qualifier("catalogCacheByPromotionalProduct") public void setCacheByPromotionalProductKeyGen(@Nullable com.broadleafcommerce.common.extension.cache.key.ContextKeyGen cacheByPromotionalProductKeyGen)
      See Also:
    • getCacheByPromotionalProductKeyGen

      @Nullable protected com.broadleafcommerce.common.extension.cache.key.ContextKeyGen getCacheByPromotionalProductKeyGen()
      See Also: