Interface ContentItemRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
- All Superinterfaces:
CustomizedContentItemRepository<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:
JpaContentItemRepository<D>
@NoRepositoryBean
public interface ContentItemRepository<D extends com.broadleafcommerce.data.tracking.core.Trackable>
extends CustomizedContentItemRepository<D>, com.broadleafcommerce.data.tracking.core.TrackableRepository<D>, com.broadleafcommerce.data.tracking.core.TrackableRsqlFilterExecutor<D>
Repository for persistent counter-parts of
ContentItem
.- Author:
- Jon Fleschler (jfleschler)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
existsByModelContextId
(String modelContextId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) findAllByContextIdIn
(Collection<String> ids, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads allContentItems
matching the given ids.org.springframework.data.domain.Page<D>
findAllByContextIdIn
(Collection<String> ids, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads allContentItems
matching the given ids.findAllByContextIdIn
(List<String> contentItemIdList, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all content for a given list of idsfindAllByModelContextId
(String contextId, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all content for a specific model.org.springframework.data.domain.Page<D>
findAllByModelContextId
(String modelId, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Read all content for a specific model.org.springframework.data.domain.Page<D>
findAllByNameContainingIgnoreCase
(String nameQuery, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all content models, filtered by name.findAllByNameIn
(Collection<String> names, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads allContentItems
matching the given names.org.springframework.data.domain.Page<D>
findAllByNameIn
(Collection<String> names, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads allContentItems
matching the given names.findAllByTagsIsNotNull
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all content where tags is not nullorg.springframework.data.domain.Page<D>
findAllByUriIsNotNullAndUriNot
(String uri, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Read allContentItems
whoseContentItem.getUri()
is not equal to the value specified by the uri parameterfindByModelContextIdAndUri
(String modelContextId, String uri, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) findByName
(String contentName, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated, for removal: This API element is subject to removal in a future version.since 2.1.3.findByNameAndEmbeddedFalse
(String contentName, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find the non-embedded content item with the given name.Methods inherited from interface com.broadleafcommerce.content.repository.CustomizedContentItemRepository
findAllActiveByName, findAllByQuery, findAllInactiveByName, findByCombinedModelAndItemUris
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
-
findAllByNameContainingIgnoreCase
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByNameContainingIgnoreCase(String nameQuery, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all content models, filtered by name.- Parameters:
nameQuery
- the content name to filter bypage
- the requested page of results from the databasefilters
- additional filters to apply in the query. Should beEmptyNode
if no additional filters should be applied.contextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- all content, filtered by name
-
findAllByNameIn
@Policy(operationTypes=READ) List<D> findAllByNameIn(Collection<String> names, cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads allContentItems
matching the given names.- Parameters:
names
- Names of theContentItems
to retrieve.filters
- additional filters to apply in the query. Should beEmptyNode
if no additional filters should be applied.context
- context information surrounding sandboxing and multitenant state- Returns:
- All
ContentItems
matching the given names.
-
findAllByNameIn
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByNameIn(Collection<String> names, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads allContentItems
matching the given names.- Parameters:
names
- Names of theContentItems
to retrieve.page
- the requested page of results from the databasefilters
- additional filters to apply in the query. Should beEmptyNode
if no additional filters should be applied.context
- context information surrounding sandboxing and multitenant state- Returns:
- A page of all
ContentItems
matching the given names.
-
findAllByContextIdIn
@Policy(operationTypes=READ) List<D> findAllByContextIdIn(Collection<String> ids, cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads allContentItems
matching the given ids.- Parameters:
ids
- Names of theContentItems
to retrieve.filters
- additional filters to apply in the query. Should beEmptyNode
if no additional filters should be applied.context
- context information surrounding sandboxing and multitenant state- Returns:
- All
ContentItems
matching the given ids.
-
findAllByContextIdIn
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByContextIdIn(Collection<String> ids, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Reads allContentItems
matching the given ids.- Parameters:
ids
- Names of theContentItems
to retrieve.page
- the requested page of results from the databasefilters
- additional filters to apply in the query. Should beEmptyNode
if no additional filters should be applied.context
- context information surrounding sandboxing and multitenant state- Returns:
- A page of all
ContentItems
matching the given ids.
-
findByName
@Deprecated(since="2.1.3.", forRemoval=true) @Policy(operationTypes=READ) default Optional<D> findByName(String contentName, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated, for removal: This API element is subject to removal in a future version.since 2.1.3. Content names are not unique for all content, they are only unique for non-embedded content. UsefindByNameAndEmbeddedFalse(String, ContextInfo)
instead.Find the content item with the given name. There should only be one result, as content names are unique.- Parameters:
contentName
- the name of the content to retrievecontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- an
Optional
containing the content that was found, empty otherwise
-
findByNameAndEmbeddedFalse
@Policy(operationTypes=READ) Optional<D> findByNameAndEmbeddedFalse(String contentName, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find the non-embedded content item with the given name. There should only be one result, as content names are unique in all non-embedded items (ContentItem.getEmbedded()
is `false`).- Parameters:
contentName
- the name of the content to retrievecontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- an
Optional
containing the content that was found, empty otherwise
-
findAllByModelContextId
@Policy(operationTypes=READ) List<D> findAllByModelContextId(String contextId, cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all content for a specific model.- Parameters:
contextId
- the content's model idfilters
- additional filters to apply in the query. Should beEmptyNode
if no additional filters should be applied.contextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- a list of content items associated with a model
-
findAllByModelContextId
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByModelContextId(String modelId, org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Read all content for a specific model.- Parameters:
modelId
- the content's model idpage
- the requested page of results from the databasefilters
- additional filters to apply in the query, can be nullcontext
- context information surrounding sandboxing and multitenant state- Returns:
- a page of content items associated with a model
-
findAllByUriIsNotNullAndUriNot
@Policy(operationTypes=READ) org.springframework.data.domain.Page<D> findAllByUriIsNotNullAndUriNot(String uri, org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Read allContentItems
whoseContentItem.getUri()
is not equal to the value specified by the uri parameter- Parameters:
uri
- the uri value which should not be to be included in the resultpage
- the requested page of results from the databasecontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- a page of non-null content items
-
findByModelContextIdAndUri
@Policy(operationTypes=READ) Optional<D> findByModelContextIdAndUri(String modelContextId, String uri, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Parameters:
modelContextId
- ID of the model the item belongs touri
- URI of the itemcontextInfo
- Context information surrounding sandboxing and multitenant state- Returns:
- The
ContentItem
by matchingmodelContextId
anduri
.
-
findAllByContextIdIn
List<D> findAllByContextIdIn(List<String> contentItemIdList, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all content for a given list of ids- Parameters:
contentItemIdList
- the list of content model idscontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- a list of content items
-
findAllByTagsIsNotNull
List<D> findAllByTagsIsNotNull(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all content where tags is not null- Parameters:
contextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- a list of content items
-
existsByModelContextId
boolean existsByModelContextId(String modelContextId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) - Parameters:
modelContextId
- modelContextId ID of the model the item belongs tocontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- true if there is a content item for a given parameters
-