Class JpaCustomizedCategoryRepository<D extends JpaCategory>
java.lang.Object
com.broadleafcommerce.catalog.provider.jpa.repository.category.JpaCustomizedCategoryRepository<D>
- All Implemented Interfaces:
CustomizedCategoryRepository<D>
,org.springframework.beans.factory.InitializingBean
public class JpaCustomizedCategoryRepository<D extends JpaCategory>
extends Object
implements CustomizedCategoryRepository<D>, org.springframework.beans.factory.InitializingBean
- Author:
- Samarth Dhruva (samarthd)
-
Constructor Summary
ConstructorDescriptionJpaCustomizedCategoryRepository
(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder filterRulesCriteriaBuilder, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected javax.persistence.criteria.Predicate
buildContextIdInFilter
(Collection<String> contextIds, javax.persistence.criteria.Root<D> categoryEntity, javax.persistence.criteria.CriteriaBuilder criteriaBuilder, Map<String, Object> parameterValues) findAllByContextId
(@NonNull Iterable<String> contextIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Returns all theCategories
that match thecontextIds
.findAllByContextIdIn
(@NonNull Collection<String> contextIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieves all categories whose context IDs match any of the given IDs.findAllByUrls
(Iterable<String> urls, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Finds categories by the given urls.Finds a category by the given url.protected com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil
protected com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder
protected javax.persistence.EntityManager
protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper
protected CategoryRepository<D>
protected com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager
void
setRepository
(CategoryRepository<D> repository)
-
Constructor Details
-
JpaCustomizedCategoryRepository
public JpaCustomizedCategoryRepository(com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder filterRulesCriteriaBuilder, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager)
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
setRepository
-
findAllByContextIdIn
@Policy(operationTypes=READ) public Stream<D> findAllByContextIdIn(@NonNull @NonNull Collection<String> contextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CustomizedCategoryRepository
Retrieves all categories whose context IDs match any of the given IDs.- Specified by:
findAllByContextIdIn
in interfaceCustomizedCategoryRepository<D extends JpaCategory>
- Parameters:
contextIds
- the context IDs to query forcontextInfo
- context information around sandbox and multitenant state- Returns:
- all categories whose context IDs match any of the given IDs
-
findByUrl
public Optional<D> findByUrl(String url, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:CustomizedCategoryRepository
Finds a category by the given url.- Specified by:
findByUrl
in interfaceCustomizedCategoryRepository<D extends JpaCategory>
- Parameters:
url
- the url to look bycontext
- the current context to look in- Returns:
- The Category matching the
url
, orOptional.empty()
if none found
-
findAllByUrls
public List<D> findAllByUrls(Iterable<String> urls, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:CustomizedCategoryRepository
Finds categories by the given urls.- Specified by:
findAllByUrls
in interfaceCustomizedCategoryRepository<D extends JpaCategory>
- Parameters:
urls
- the urls to look bycontext
- the current context to look in- Returns:
- The Category matching the
urls
.
-
findAllByContextId
public List<D> findAllByContextId(@NonNull @NonNull Iterable<String> contextIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:CustomizedCategoryRepository
Returns all theCategories
that match thecontextIds
.- Specified by:
findAllByContextId
in interfaceCustomizedCategoryRepository<D extends JpaCategory>
- Parameters:
contextIds
- IDs to match againstcontext
- the current context to look in- Returns:
- All the
Categories
that match thecontextIds
.
-
buildContextIdInFilter
-
getNarrowingHelper
protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper getNarrowingHelper() -
getEntityManager
protected javax.persistence.EntityManager getEntityManager() -
getRepository
-
getBehaviorUtil
protected com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil getBehaviorUtil() -
getCriteriaBuilder
protected com.broadleafcommerce.data.tracking.jpa.filtering.fetch.rsql.JpaFiltersCriteriaBuilder getCriteriaBuilder() -
getRepositoryEntityTypeManager
protected com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager getRepositoryEntityTypeManager()
-