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
ConstructorsConstructorDescriptionDefaultCustomerAddressService(CustomerAddressRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 theCustomerAddresswhich 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, readAllMethods 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, updateSortMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSortMethods 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:
createin interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends CustomerAddress>- Overrides:
createin classcom.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:
replacein interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends CustomerAddress>- Overrides:
replacein classcom.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:CustomerAddressServiceReads all of the CustomerAddress relationships in the database associated with the given customer context ID.- Specified by:
readByCustomerContextIdin interfaceCustomerAddressService<P extends CustomerAddress>- Parameters:
customerContextId- the customer context ID to find the relationships forfilters- additional filters to apply in the query. Should beEmptyNodeif no additional filters should be applied.page- the requested page of results from the databasecontextInfo- 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:CustomerAddressServiceReads all customer addresses in the datastore associated with the given customer IDs.- Specified by:
readByCustomerIdInin interfaceCustomerAddressService<P extends CustomerAddress>- Parameters:
customerIds- all customer IDs to find addresses forcontextInfo- 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:CustomerAddressServiceFinds theCustomerAddresswhich has the given ID and parent customer ID.- Specified by:
readByIdAndCustomerIdin interfaceCustomerAddressService<P extends CustomerAddress>- Parameters:
id- the context ID of theCustomerAddresscustomerId- the context ID of the parentCustomercontextInfo- 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:
getRepositoryin classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends CustomerAddress>
-