Class DefaultCustomerAddressService<P extends CustomerAddress>

  • 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)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      P create​(P customerAddress, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)  
      protected CustomerAddressRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository()  
      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.
      P 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.
      P 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 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 Detail

      • DefaultCustomerAddressService

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

      • 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
      • 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>