Class DefaultCustomerAddressService<P extends CustomerAddress>

java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.customer.service.DefaultCustomerAddressService<P>
All Implemented Interfaces:
CustomerAddressService<P>, com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>

public class DefaultCustomerAddressService<P extends CustomerAddress> extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P> implements CustomerAddressService<P>
Author:
Samarth Dhruva (samarthd)
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultCustomerAddressService(CustomerAddressRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(P customerAddress, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     
    protected CustomerAddressRepository<com.broadleafcommerce.data.tracking.core.Trackable>
     
    org.springframework.data.domain.Page<P>
    readByCustomerContextId(@NonNull String customerContextId, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Reads all of the CustomerAddress relationships in the database associated with the given customer context ID.
    readByCustomerIdIn(@NonNull Set<String> customerIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Reads all customer addresses in the datastore associated with the given customer IDs.
    readByIdAndCustomerId(@NonNull String id, @NonNull String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Finds the CustomerAddress which has the given ID and parent customer ID.
    replace(@NonNull String customerAddressId, P customerAddress, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
     

    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, createAll, createAllAllowingPartialSuccess, delete, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, 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

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

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

    readAll, readAll, readAll, readAll
  • Constructor Details

    • DefaultCustomerAddressService

      public DefaultCustomerAddressService(CustomerAddressRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
  • Method Details

    • create

      @Transactional("customerTransactionManager") public P create(@NonNull P customerAddress, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      create in interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends CustomerAddress>
      Overrides:
      create in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends CustomerAddress>
    • replace

      @Transactional("customerTransactionManager") public P replace(@NonNull @NonNull String customerAddressId, @NonNull P customerAddress, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Specified by:
      replace in interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends CustomerAddress>
      Overrides:
      replace in class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends CustomerAddress>
    • readByCustomerContextId

      public org.springframework.data.domain.Page<P> readByCustomerContextId(@NonNull @NonNull String customerContextId, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CustomerAddressService
      Reads all of the CustomerAddress relationships in the database associated with the given customer context ID.
      Specified by:
      readByCustomerContextId in interface CustomerAddressService<P extends CustomerAddress>
      Parameters:
      customerContextId - the customer context ID to find the relationships for
      filters - additional filters to apply in the query. Should be EmptyNode if no additional filters should be applied.
      page - the requested page of results from the database
      contextInfo - the context to query within
      Returns:
      the CustomerAddress relationships in the database that match the given customer context ID
    • readByCustomerIdIn

      public List<P> readByCustomerIdIn(@NonNull @NonNull Set<String> customerIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CustomerAddressService
      Reads all customer addresses in the datastore associated with the given customer IDs.
      Specified by:
      readByCustomerIdIn in interface CustomerAddressService<P extends CustomerAddress>
      Parameters:
      customerIds - all customer IDs to find addresses for
      contextInfo - context around multitenant state
      Returns:
      a list of customer address relationships in the datastore matching the given customer IDs
      See Also:
    • readByIdAndCustomerId

      public P readByIdAndCustomerId(@NonNull @NonNull String id, @NonNull @NonNull String customerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CustomerAddressService
      Finds the CustomerAddress which has the given ID and parent customer ID.
      Specified by:
      readByIdAndCustomerId in interface CustomerAddressService<P extends CustomerAddress>
      Parameters:
      id - the context ID of the CustomerAddress
      customerId - the context ID of the parent Customer
      contextInfo - context surrounding sandboxing and multitenant state
      Returns:
      the customer address that has the given ID and parent customer ID
    • getRepository

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