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
-
Constructor Summary
ConstructorDescriptionDefaultPromotionalCategoryProductService
(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 TypeMethodDescriptionprotected com.broadleafcommerce.common.extension.cache.key.ContextKeyGen
protected com.broadleafcommerce.common.extension.cache.CacheStateManager
protected PromotionalCategoryProductRepository<com.broadleafcommerce.data.tracking.core.Trackable>
readAllByCategoryIdsIn
(@NonNull Collection<String> categoryIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all the PromotionalCategoryProduct relationships in the database associated with the given category context IDs.readAllByProductIdsIn
(@NonNull Collection<String> productIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all of the PromotionalCategoryProduct relationships in the database associated with the given product context IDs.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
-
CACHE_BY_PROMOTIONAL_PRODUCT
- See Also:
-
-
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 interfacePromotionalCategoryProductService<P extends PromotionalCategoryProduct>
- Parameters:
categoryContextId
- the category context ID to find the relations fortype
- the type of promotion to filter by (optional)page
- the requested page of results from the databasecontextInfo
- 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 interfacePromotionalCategoryProductService<P extends PromotionalCategoryProduct>
- Parameters:
productId
- the product context IDcategoryId
- the category context IDcontextInfo
- 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 interfacePromotionalCategoryProductService<P extends PromotionalCategoryProduct>
- Parameters:
categoryId
- the category context ID to find the relationships forcontextInfo
- the context to query within- Returns:
- the PromotionalCategoryProduct relationships in the database that match the given category context ID
-
readAllByProductIdsIn
@NonNull public List<P> readAllByProductIdsIn(@NonNull @NonNull Collection<String> productIds, @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 product context IDs.- Specified by:
readAllByProductIdsIn
in interfacePromotionalCategoryProductService<P extends PromotionalCategoryProduct>
- Parameters:
productIds
- the product context IDs to find the relationships forcontextInfo
- the context to query within- Returns:
- the PromotionalCategoryProduct relationships in the database that match the given product context IDs
-
readAllByCategoryIdsIn
@NonNull public List<P> readAllByCategoryIdsIn(@NonNull @NonNull Collection<String> categoryIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:PromotionalCategoryProductService
Reads all the PromotionalCategoryProduct relationships in the database associated with the given category context IDs.- Specified by:
readAllByCategoryIdsIn
in interfacePromotionalCategoryProductService<P extends PromotionalCategoryProduct>
- Parameters:
categoryIds
- the category context IDs to find the relationships forcontextInfo
- the context to query within- Returns:
- the PromotionalCategoryProduct relationships in the database that match the given category context IDs
-
getRepositoryDomain
- Specified by:
getRepositoryDomain
in interfacePromotionalCategoryProductService<P extends PromotionalCategoryProduct>
-
getRepository
@NonNull protected PromotionalCategoryProductRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()- Overrides:
getRepository
in classcom.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:
-