Class DefaultOptionTemplateService<P extends OptionTemplate>

java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.catalog.service.option.DefaultOptionTemplateService<P>
All Implemented Interfaces:
OptionTemplateService<P>, com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>

public class DefaultOptionTemplateService<P extends OptionTemplate> extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P> implements OptionTemplateService<P>
Author:
Nathan Moore (nathanmoore).
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultOptionTemplateService(OptionTemplateRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> parser)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.springframework.data.domain.Page<P>
    convertToBusinessDomain(org.springframework.data.domain.Page<com.broadleafcommerce.data.tracking.core.Trackable> trackableProductOptions, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    protected OptionTemplateRepository<com.broadleafcommerce.data.tracking.core.Trackable>
     
     
    readAllByCategoryIdsIn(@NonNull Collection<String> categoryIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Finds all option templates by category IDs in the supplied collection.
    readAllByIds(@NonNull Collection<String> optionTemplateIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Finds all option templates with IDs in the supplied collection.
    org.springframework.data.domain.Page<P>
    readAllByName(@NonNull String name, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     
    readById(@NonNull String optionTemplateId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     

    Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService

    getRsqlHelper, readAll, readAll, readAll, readAll

    Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService

    convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService

    create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort

    Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService

    readAll, readAll, readAll, readAll
  • Constructor Details

    • DefaultOptionTemplateService

      public DefaultOptionTemplateService(OptionTemplateRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.data.tracking.core.filtering.fetch.FilterParser<cz.jirutka.rsql.parser.ast.Node> parser)
  • Method Details

    • readAllByName

      public org.springframework.data.domain.Page<P> readAllByName(@NonNull @NonNull String name, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      readAllByName in interface OptionTemplateService<P extends OptionTemplate>
    • convertToBusinessDomain

      protected org.springframework.data.domain.Page<P> convertToBusinessDomain(org.springframework.data.domain.Page<com.broadleafcommerce.data.tracking.core.Trackable> trackableProductOptions, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • readAllByIds

      public List<P> readAllByIds(@NonNull @NonNull Collection<String> optionTemplateIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OptionTemplateService
      Finds all option templates with IDs in the supplied collection.
      Specified by:
      readAllByIds in interface OptionTemplateService<P extends OptionTemplate>
      Parameters:
      optionTemplateIds - the option template IDs to search for
      contextInfo - the context to perform the operation in
      Returns:
      the option templates that matched with the IDs in the given collection
    • readAllByCategoryIdsIn

      public List<P> readAllByCategoryIdsIn(@NonNull @NonNull Collection<String> categoryIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OptionTemplateService
      Finds all option templates by category IDs in the supplied collection.
      Specified by:
      readAllByCategoryIdsIn in interface OptionTemplateService<P extends OptionTemplate>
      Parameters:
      categoryIds - the category IDs to use to search for option template/s
      contextInfo - the context to perform the operation in
      Returns:
      the option templates that matched with the category IDs in the given collection
    • readById

      public P readById(@NonNull @NonNull String optionTemplateId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      readById in interface OptionTemplateService<P extends OptionTemplate>
    • getRepositoryDomain

      public String getRepositoryDomain()
      Specified by:
      getRepositoryDomain in interface OptionTemplateService<P extends OptionTemplate>
    • getRepository

      @NonNull protected OptionTemplateRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()
      Overrides:
      getRepository in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends OptionTemplate>