Class ProductConfigurationPersistenceServiceImpl
java.lang.Object
de.hybris.platform.sap.productconfig.services.impl.ProductConfigurationPersistenceServiceImpl
- All Implemented Interfaces:
ProductConfigurationPersistenceService
public class ProductConfigurationPersistenceServiceImpl
extends Object
implements ProductConfigurationPersistenceService
Default implementation for
ProductConfigurationPersistenceService.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DatecalculateModificationDate(Integer thresholdInDays) protected PaginatedFlexibleSearchParametercreatePageableQuery(FlexibleSearchQuery query, int pageSize, int currentPage) getAbstractOrderEntryByConfigPk(String configPk, boolean isDraft) Get an abstract order entry by a configuration ID that can either represent the current product configuration attached to it or the current configuration draft.getAll(int pageSize, int currentPage) Gets all configurations currently persistetgetAllOrderEntriesByConfigId(String configId) Get all order entries to which the given config is currently assigned to.protected List<AbstractOrderEntryModel>getAllOrderEntriesByModel(ProductConfigurationModel productConfigurationModel) getByConfigId(String configId, boolean allowNull) read theProductConfigurationModelby configIdgetByProductCode(String productCode) read theProductConfigurationModelassociated to the given product code for the current user.getByProductCodeAndUser(String productCode, UserModel user) read allProductConfigurationModels currently linked to the given product and usergetByUserSessionId(String userSessionId) read the list ofProductConfigurationModelassociated to the given user session idprotected FlexibleSearchServicegetOrderEntryByConfigId(String configId, boolean isDraft) get the order entry to which the given config is currently assigned to.getOrderEntryByPK(String cartEntryKey) read theAbstractOrderEntryModelby PKgetOrphaned(int pageSize, int currentPage) Gets configurations that are neither related to any abstract order entry nor are related to any Product.protected PaginatedFlexibleSearchServicegetProductConfigByConfigId(String configId) Get product configuration model by configuration identifiergetProductRelatedByThreshold(Integer thresholdInDays, int pageSize, int currentPage) Gets configurations that are not related to abstract order entries and have not been touched for a certain time (specified in days)protected SessionServiceprotected intgetTotalCount(Map<String, String> params, String queryString) protected UserServicebooleanisOnlyRelatedToGivenEntry(String configId, String cartEntryKey) Checks whether a configuration is linked to more than the given abstract order entry.booleanIs this model related to any abstract order entry, be it draft or not?voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService) voidsetPaginatedFlexibleSearchService(PaginatedFlexibleSearchService paginatedFlexibleSearchService) voidsetSessionService(SessionService sessionService) voidsetUserService(UserService userService) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.sap.productconfig.services.intf.ProductConfigurationPersistenceService
getByConfigId
-
Field Details
-
PARAM_NAME_CONFIG_ID
- See Also:
-
PARAM_NAME_CONFIG_PK
- See Also:
-
-
Constructor Details
-
ProductConfigurationPersistenceServiceImpl
public ProductConfigurationPersistenceServiceImpl()
-
-
Method Details
-
getByConfigId
Description copied from interface:ProductConfigurationPersistenceServiceread theProductConfigurationModelby configId- Specified by:
getByConfigIdin interfaceProductConfigurationPersistenceService- Parameters:
configId- configuration idallowNull- iftruenull is returned if no configuration with the given id is found, otherwise an exception is thrown- Returns:
- n product configuration persistence model
-
getOrderEntryByConfigId
Description copied from interface:ProductConfigurationPersistenceServiceget the order entry to which the given config is currently assigned to. throws an AmbigiousIdentifierException, if there exists more than one OrderEntry linked to the given configId.- Specified by:
getOrderEntryByConfigIdin interfaceProductConfigurationPersistenceService- Parameters:
configId- product configuration idisDraft- iftruedraft link will be checked, otherwise default link- Returns:
- order entry
-
getProductConfigByConfigId
Get product configuration model by configuration identifier- Parameters:
configId- External identifier of the product configuration model- Returns:
- Product configuration model
-
getAbstractOrderEntryByConfigPk
Get an abstract order entry by a configuration ID that can either represent the current product configuration attached to it or the current configuration draft. The latter is only possible for cart entries.- Parameters:
configPk- PK ofAbstractOrderEntryModelisDraft- Does PK belong to draft configuration?- Returns:
- Entry model
-
getAllOrderEntriesByConfigId
Description copied from interface:ProductConfigurationPersistenceServiceGet all order entries to which the given config is currently assigned to. In most scenarios this is exactly one or no entry at all.- Specified by:
getAllOrderEntriesByConfigIdin interfaceProductConfigurationPersistenceService- Parameters:
configId- product configuration id- Returns:
- order entry
-
getAllOrderEntriesByModel
protected List<AbstractOrderEntryModel> getAllOrderEntriesByModel(ProductConfigurationModel productConfigurationModel) -
getByProductCode
Description copied from interface:ProductConfigurationPersistenceServiceread theProductConfigurationModelassociated to the given product code for the current user. In case of an anoymous user, the user seesion id is used.- Specified by:
getByProductCodein interfaceProductConfigurationPersistenceService- Parameters:
productCode- product Code- Returns:
- product configuration persistence model
-
getByProductCodeAndUser
Description copied from interface:ProductConfigurationPersistenceServiceread allProductConfigurationModels currently linked to the given product and user- Specified by:
getByProductCodeAndUserin interfaceProductConfigurationPersistenceService- Parameters:
productCode- product Codeuser- user model- Returns:
- product configuration persistence model
-
getOrderEntryByPK
Description copied from interface:ProductConfigurationPersistenceServiceread theAbstractOrderEntryModelby PK- Specified by:
getOrderEntryByPKin interfaceProductConfigurationPersistenceService- Parameters:
cartEntryKey- cart Entry PK- Returns:
- order entry
-
getByUserSessionId
Description copied from interface:ProductConfigurationPersistenceServiceread the list ofProductConfigurationModelassociated to the given user session id- Specified by:
getByUserSessionIdin interfaceProductConfigurationPersistenceService- Parameters:
userSessionId- id of the user session- Returns:
- list of product configuration persistence models
-
getProductRelatedByThreshold
public SearchPageData<ProductConfigurationModel> getProductRelatedByThreshold(Integer thresholdInDays, int pageSize, int currentPage) Description copied from interface:ProductConfigurationPersistenceServiceGets configurations that are not related to abstract order entries and have not been touched for a certain time (specified in days)- Specified by:
getProductRelatedByThresholdin interfaceProductConfigurationPersistenceService- Parameters:
thresholdInDays- Select entries that are older than current date - thresholdpageSize- max number of models to be read within one invocationcurrentPage- page idx to read- Returns:
- List of product configuration persistence models
-
getOrphaned
Description copied from interface:ProductConfigurationPersistenceServiceGets configurations that are neither related to any abstract order entry nor are related to any Product. So they are considered orphaned.- Specified by:
getOrphanedin interfaceProductConfigurationPersistenceService- Parameters:
pageSize- max number of models to be read within one invocationcurrentPage- page idx to read- Returns:
- List of product configuration persistence models
-
getAll
Description copied from interface:ProductConfigurationPersistenceServiceGets all configurations currently persistet- Specified by:
getAllin interfaceProductConfigurationPersistenceService- Parameters:
pageSize- max number of models to be read within one invocationcurrentPage- page idx to read- Returns:
- List of product configuration persistence models
-
isOnlyRelatedToGivenEntry
Description copied from interface:ProductConfigurationPersistenceServiceChecks whether a configuration is linked to more than the given abstract order entry.- Specified by:
isOnlyRelatedToGivenEntryin interfaceProductConfigurationPersistenceService- Parameters:
configId- config id to checkcartEntryKey- Pk of abstract order entry- Returns:
true, only if the given configuration id is only linked to the given abstract order entry.
-
getTotalCount
-
createPageableQuery
protected PaginatedFlexibleSearchParameter createPageableQuery(FlexibleSearchQuery query, int pageSize, int currentPage) -
calculateModificationDate
-
getFlexibleSearchService
-
setFlexibleSearchService
-
getUserService
-
setUserService
-
getSessionService
-
setSessionService
-
getPaginatedFlexibleSearchService
-
setPaginatedFlexibleSearchService
public void setPaginatedFlexibleSearchService(PaginatedFlexibleSearchService paginatedFlexibleSearchService) -
isRelatedToAbstractOrderEntry
Description copied from interface:ProductConfigurationPersistenceServiceIs this model related to any abstract order entry, be it draft or not?- Specified by:
isRelatedToAbstractOrderEntryin interfaceProductConfigurationPersistenceService- Parameters:
model- ProductConfiguration representation in commerce persistence- Returns:
trueif and only if related to any abstract order entry model
-