Interface CategoryRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
- All Superinterfaces:
CustomizedCategoryRepository<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:
JpaCategoryRepository<D>
@NoRepositoryBean
public interface CategoryRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
extends com.broadleafcommerce.data.tracking.core.TrackableRepository<D>, com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor<D>, CustomizedCategoryRepository<D>
- Author:
- Phillip Verheyden (phillipuniverse), Jeff Fischer
-
Method Summary
Modifier and TypeMethodDescriptionorg.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 categories whose context IDs match any of the given IDs.findAllByParentCategoryContextId
(String parentContextId, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns all theCategories
whose parent has the ID given asparentContextId
and are within the given date range.org.springframework.data.domain.Page<D>
findAllByParentCategoryContextId
(String parentCategoryContextId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Read all categories in the database that have the given category context ID set as their parent category.org.springframework.data.domain.Page<D>
findAllByParentCategoryContextIdIn
(Collection<String> parentCategoryIds, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) org.springframework.data.domain.Page<D>
findAllByParentCategoryContextIdIsNull
(cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all of the categories who do not specify a parent category.findByExternalId
(String externalId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find a category by its external IDfindByExternalIdIn
(Collection<String> externalIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find a list of categories by the supplied external IDsorg.springframework.data.domain.Page<D>
findByExternalIdIn
(Collection<String> externalIds, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find categories byJpaCategory.externalId
findByNameIn
(Collection<String> names, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns allCategories
whos names match the provided names.Methods inherited from interface com.broadleafcommerce.catalog.repository.category.CustomizedCategoryRepository
findAllByContextId, findAllByContextIdIn, findAllByUrls, findByUrl
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(Collection<String> contextIdList, org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves a paged list of categories 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 categories whose context IDs match any of the given IDs
-
findAllByParentCategoryContextId
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByParentCategoryContextId(String parentCategoryContextId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Read all categories in the database that have the given category context ID set as their parent category.- Parameters:
parentCategoryContextId
- the category context ID whose children should be foundfilters
- 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
- context surrounding sandboxing and multitenant state- Returns:
- the children categories of the category identified by the given context ID
-
findAllByParentCategoryContextIdIn
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByParentCategoryContextIdIn(Collection<String> parentCategoryIds, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
findAllByParentCategoryContextId
@Policy(operationTypes=READ) List<D> findAllByParentCategoryContextId(String parentContextId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns all theCategories
whose parent has the ID given asparentContextId
and are within the given date range.- Parameters:
parentContextId
- ID of the parent categorycontext
- the current context to look in- Returns:
- All the
Categories
that match thecontextIds
and are within the given date range.
-
findAllByParentCategoryContextIdIsNull
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByParentCategoryContextIdIsNull(cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all of the categories who do not specify a parent category. These are interpreted as being "top-level" categories.- Parameters:
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 around sandboxing and multitenant state- Returns:
- the "top-level" categories, filtered by name
-
findByNameIn
@Policy(operationTypes=READ) List<D> findByNameIn(Collection<String> names, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns allCategories
whos names match the provided names.- Parameters:
names
- a collection of names to filter bycontext
- context the current context to look in- Returns:
- All the
Categories
that match the providednames
.
-
findByExternalIdIn
@Policy(operationTypes=READ) List<D> findByExternalIdIn(Collection<String> externalIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find a list of categories by the supplied external IDs- Parameters:
externalIds
- The external IDs to query forcontextInfo
- the context around sandboxing and multitenant state- Returns:
- A list of categories
-
findByExternalIdIn
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findByExternalIdIn(Collection<String> externalIds, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find categories byJpaCategory.externalId
- Parameters:
externalIds
- The external IDs to query forfilters
- 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 around sandboxing and multitenant state- Returns:
- A page of categories
-
findByExternalId
@Policy(operationTypes=READ) Optional<D> findByExternalId(String externalId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find a category by its external ID- Parameters:
externalId
- The external IDcontextInfo
- the context around sandboxing and multitenant state
-