Class DefaultPromotionalProductService<P extends PromotionalProduct>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.catalog.service.product.relation.DefaultPromotionalProductService<P>
- All Implemented Interfaces:
PromotionalProductService<P>
,com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
public class DefaultPromotionalProductService<P extends PromotionalProduct>
extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
implements PromotionalProductService<P>
- Author:
- Samarth Dhruva (samarthd)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultPromotionalProductService
(PromotionalProductRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, ProductService<Product> productSvc, 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 ProductService<Product>
protected PromotionalProductRepository<com.broadleafcommerce.data.tracking.core.Trackable>
org.springframework.data.domain.Page<P>
readAllByProductId
(@NonNull String productId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all of thePromotionalProducts
associated with the givenproduct ID
.readAllByProductIds
(@NonNull Collection<String> productIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Reads all of thePromotionalProducts
associated with the givenproduct IDs
.void
setCacheByIdPromotionalProductKeyGen
(com.broadleafcommerce.common.extension.cache.key.ContextKeyGen cacheByIdPromotionalProductKeyGen) 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_ID_PROMOTIONAL_PRODUCT
- See Also:
-
-
Constructor Details
-
DefaultPromotionalProductService
public DefaultPromotionalProductService(PromotionalProductRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, ProductService<Product> productSvc, @Nullable com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager)
-
-
Method Details
-
readAllByProductId
public org.springframework.data.domain.Page<P> readAllByProductId(@NonNull @NonNull String productId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:PromotionalProductService
Reads all of thePromotionalProducts
associated with the givenproduct ID
.- Specified by:
readAllByProductId
in interfacePromotionalProductService<P extends PromotionalProduct>
- Parameters:
productId
- TheProduct ID
for which to find associatedPromotionalProducts
filters
- additional filters to apply in the query. Should beEmptyNode
if no additional filters should be applied.page
- the requested page of results from the databasecontextInfo
- the context to query within- Returns:
- Reads all of the
PromotionalProducts
associated with the givenproduct ID
.
-
readAllByProductIds
public List<P> readAllByProductIds(@NonNull @NonNull Collection<String> productIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:PromotionalProductService
Reads all of thePromotionalProducts
associated with the givenproduct IDs
.- Specified by:
readAllByProductIds
in interfacePromotionalProductService<P extends PromotionalProduct>
- Parameters:
productIds
- TheProduct IDs
for which to find associatedPromotionalProducts
contextInfo
- the context to query within- Returns:
- Reads all of the
PromotionalProducts
associated with the givenproduct IDs
.
-
getRepositoryDomain
- Specified by:
getRepositoryDomain
in interfacePromotionalProductService<P extends PromotionalProduct>
-
getRepository
@NonNull protected PromotionalProductRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()- Overrides:
getRepository
in classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends PromotionalProduct>
-
getProductService
-
getCacheStateManager
@Nullable protected com.broadleafcommerce.common.extension.cache.CacheStateManager getCacheStateManager() -
setCacheByIdPromotionalProductKeyGen
@Autowired @Qualifier("catalogCacheByIdPromotionalProduct") public void setCacheByIdPromotionalProductKeyGen(@Nullable com.broadleafcommerce.common.extension.cache.key.ContextKeyGen cacheByIdPromotionalProductKeyGen) - See Also:
-
getCacheByIdPromotionalProductKeyGen
@Nullable protected com.broadleafcommerce.common.extension.cache.key.ContextKeyGen getCacheByIdPromotionalProductKeyGen()- See Also:
-