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 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 interface org.springframework.beans.factory.InitializingBean
    • setRepository

      @Autowired @Lazy public void setRepository(CategoryRepository<D> repository)
    • 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 interface CustomizedCategoryRepository<D extends JpaCategory>
      Parameters:
      contextIds - the context IDs to query for
      contextInfo - 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 interface CustomizedCategoryRepository<D extends JpaCategory>
      Parameters:
      url - the url to look by
      context - the current context to look in
      Returns:
      The Category matching the url, or Optional.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 interface CustomizedCategoryRepository<D extends JpaCategory>
      Parameters:
      urls - the urls to look by
      context - 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 the Categories that match the contextIds.
      Specified by:
      findAllByContextId in interface CustomizedCategoryRepository<D extends JpaCategory>
      Parameters:
      contextIds - IDs to match against
      context - the current context to look in
      Returns:
      All the Categories that match the contextIds.
    • buildContextIdInFilter

      protected jakarta.persistence.criteria.Predicate buildContextIdInFilter(Collection<String> contextIds, jakarta.persistence.criteria.Root<D> categoryEntity, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, Map<String,Object> parameterValues)
    • getNarrowingHelper

      protected com.broadleafcommerce.data.tracking.jpa.filtering.narrow.JpaNarrowingHelper getNarrowingHelper()
    • getEntityManager

      protected jakarta.persistence.EntityManager getEntityManager()
    • getRepository

      protected CategoryRepository<D> 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()