Interface ProductRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
- All Superinterfaces:
CustomizedProductRepository<D>
,com.broadleafcommerce.common.extension.DomainTypeAware
,com.broadleafcommerce.common.messaging.notification.NotificationStateRepository
,org.springframework.data.repository.Repository<D,
,String> com.broadleafcommerce.data.tracking.core.TrackableRepository<D>
,com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor<D>
- All Known Subinterfaces:
JpaProductRepository<D>
@NoRepositoryBean
public interface ProductRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
extends com.broadleafcommerce.data.tracking.core.TrackableRepository<D>, CustomizedProductRepository<D>, com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor<D>
- Author:
- Phillip Verheyden (phillipuniverse)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
existsByBusinessType
(String businessType, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Checks whether anyProducts
exist that use the givenBusinessType typeKey
.org.springframework.data.domain.Page<D>
findAllByContextIdIn
(Collection<String> contextIdList, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves a paged list of products whose context IDs match any of the given IDs.findAllByExternalIdIn
(Collection<String> externalIdList, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Fetches all products whoseProduct.getExternalId()
matches any of the given values.Finds a product by the given URIMethods inherited from interface com.broadleafcommerce.catalog.repository.product.CustomizedProductRepository
findAllByCategoryContextId, findAllByCategoryContextIdAndSortType, findAllByContextIdIn, findAllByContextIdNotIn, findAllByUriIn, findAllDistinctContextId, findAllDistinctContextIdPerContext, findAllDistinctContextIdPerContextWithOptionalStipulations, findAllWithSortType
Methods inherited from interface com.broadleafcommerce.common.messaging.notification.NotificationStateRepository
findNotificationReadyMembers, setFailedNotificationAttempt, setNotificationAcknowledged
Methods inherited from interface com.broadleafcommerce.data.tracking.core.TrackableRepository
archive, existsByContextId, findAll, findAll, findAll, findAll, findAll, findAll, findAllByContextId, findByContextId, findByContextIdAndCatalog, findByNativeId, findDeployable, findMaxSortMember, findMinSortMember, findOriginal, findPromotable, findPromoteOrientedItems, findRebasable, findRejectable, findRevertable, findTarget, getDomainType, getEntityInformation, getTrackableBehaviorUtil, getTypesToRegisterInMappingContext, pruneChangeDetails, pruneRestingNotificationStates, purgeObsoleteSandboxData, save, saveAll, setTrackableBehaviorUtil
Methods inherited from interface com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor
exists, findAll, findAll, findAll, findAll
-
Method Details
-
findAllByContextIdIn
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByContextIdIn(@NonNull Collection<String> contextIdList, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves a paged list of products whose context IDs match any of the given IDs.- Parameters:
contextIdList
- the context IDs to query forpage
- the requested page of results from the databasecontextInfo
- context information around sandbox and multitenant state- Returns:
- a paged list of products whose context IDs match any of the given IDs
-
findAllByExternalIdIn
@Policy(operationTypes=READ) List<D> findAllByExternalIdIn(@NonNull Collection<String> externalIdList, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Fetches all products whoseProduct.getExternalId()
matches any of the given values.- Parameters:
externalIdList
- the list of external IDs to query forcontextInfo
- context information around sandbox and multitenant state- Returns:
- a list of products whose external IDs match any of the given values
-
findByUri
@Policy(operationTypes=READ) Optional<D> findByUri(@NonNull String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Finds a product by the given URI- Parameters:
uri
- the uri to look forcontext
- the current context to look in- Returns:
- an optional containing the Product, or an empty optional if none found
-
existsByBusinessType
@Policy(operationTypes=READ) boolean existsByBusinessType(@NonNull String businessType, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Checks whether anyProducts
exist that use the givenBusinessType typeKey
.- Parameters:
businessType
- TheBusinessType.getTypeKey()
to match with.context
- Additional multitenant and sandbox information.- Returns:
- Whether any
Products
exist that use the giventypeKey
. - Since:
- Catalog Service 2.2.0, Release Train 2.2.0
-