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
ConstructorDescriptionDefaultCustomerAddressService
(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 theCustomerAddress
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 interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends CustomerAddress>
- Overrides:
create
in 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:
replace
in interfacecom.broadleafcommerce.data.tracking.core.service.CrudEntityService<P extends CustomerAddress>
- Overrides:
replace
in 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:CustomerAddressService
Reads all of the CustomerAddress relationships in the database associated with the given customer context ID.- Specified by:
readByCustomerContextId
in interfaceCustomerAddressService<P extends CustomerAddress>
- Parameters:
customerContextId
- the customer context ID to find the relationships forfilters
- additional filters to apply in the query. Should beEmptyNode
if 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:CustomerAddressService
Reads all customer addresses in the datastore associated with the given customer IDs.- Specified by:
readByCustomerIdIn
in 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:CustomerAddressService
Finds theCustomerAddress
which has the given ID and parent customer ID.- Specified by:
readByIdAndCustomerId
in interfaceCustomerAddressService<P extends CustomerAddress>
- Parameters:
id
- the context ID of theCustomerAddress
customerId
- the context ID of the parentCustomer
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 classcom.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P extends CustomerAddress>
-