Interface ProductConfigurationPersistenceService
- All Known Implementing Classes:
ProductConfigurationPersistenceServiceImpl
public interface ProductConfigurationPersistenceService
Service to retrieve
ProductConfigurationModels from the persistence.-
Method Summary
Modifier and TypeMethodDescriptiongetAll(int pageSize, int currentPage) Gets all configurations currently persistetgetAllOrderEntriesByConfigId(String configId) Get all order entries to which the given config is currently assigned to.default ProductConfigurationModelgetByConfigId(String configId) read theProductConfigurationModelby configIdgetByConfigId(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 idgetOrderEntryByConfigId(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.getProductRelatedByThreshold(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)booleanisOnlyRelatedToGivenEntry(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?
-
Method Details
-
getByConfigId
read theProductConfigurationModelby configId- Parameters:
configId- configuration id- Returns:
- product configuration persistence model
-
getByConfigId
read theProductConfigurationModelby configId- 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
-
getByProductCode
read theProductConfigurationModelassociated to the given product code for the current user. In case of an anoymous user, the user seesion id is used.- Parameters:
productCode- product Code- Returns:
- product configuration persistence model
-
getByProductCodeAndUser
read allProductConfigurationModels currently linked to the given product and user- Parameters:
productCode- product Codeuser- user model- Returns:
- product configuration persistence model
-
getOrderEntryByPK
read theAbstractOrderEntryModelby PK- Parameters:
cartEntryKey- cart Entry PK- Returns:
- order entry
-
getOrderEntryByConfigId
get 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.- Parameters:
configId- product configuration idisDraft- iftruedraft link will be checked, otherwise default link- Returns:
- order entry
-
getAllOrderEntriesByConfigId
Get all order entries to which the given config is currently assigned to. In most scenarios this is exactly one or no entry at all.- Parameters:
configId- product configuration id- Returns:
- order entry
-
getByUserSessionId
read the list ofProductConfigurationModelassociated to the given user session id- Parameters:
userSessionId- id of the user session- Returns:
- list of product configuration persistence models
-
getProductRelatedByThreshold
SearchPageData<ProductConfigurationModel> getProductRelatedByThreshold(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)- 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
Gets configurations that are neither related to any abstract order entry nor are related to any Product. So they are considered orphaned.- Parameters:
pageSize- max number of models to be read within one invocationcurrentPage- page idx to read- Returns:
- List of product configuration persistence models
-
getAll
Gets all configurations currently persistet- Parameters:
pageSize- max number of models to be read within one invocationcurrentPage- page idx to read- Returns:
- List of product configuration persistence models
-
isOnlyRelatedToGivenEntry
Checks whether a configuration is linked to more than the given abstract order entry.- 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.
-
isRelatedToAbstractOrderEntry
Is this model related to any abstract order entry, be it draft or not?- Parameters:
model- ProductConfiguration representation in commerce persistence- Returns:
trueif and only if related to any abstract order entry model
-