Interface ProductConfigurationPersistenceService
-
- All Known Implementing Classes:
ProductConfigurationPersistenceServiceImpl
public interface ProductConfigurationPersistenceService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description SearchPageData<ProductConfigurationModel>
getAll(int pageSize, int currentPage)
Gets all configurations currently persistetjava.util.List<AbstractOrderEntryModel>
getAllOrderEntriesByConfigId(java.lang.String configId)
Get all order entries to which the given config is currently assigned to.default ProductConfigurationModel
getByConfigId(java.lang.String configId)
read theProductConfigurationModel
by configIdProductConfigurationModel
getByConfigId(java.lang.String configId, boolean allowNull)
read theProductConfigurationModel
by configIdProductConfigurationModel
getByProductCode(java.lang.String productCode)
read theProductConfigurationModel
associated to the given product code for the current user.ProductConfigurationModel
getByProductCodeAndUser(java.lang.String productCode, UserModel user)
read allProductConfigurationModel
s currently linked to the given product and userjava.util.List<ProductConfigurationModel>
getByUserSessionId(java.lang.String userSessionId)
read the list ofProductConfigurationModel
associated to the given user session idAbstractOrderEntryModel
getOrderEntryByConfigId(java.lang.String configId, boolean isDraft)
get the order entry to which the given config is currently assigned to.AbstractOrderEntryModel
getOrderEntryByPK(java.lang.String cartEntryKey)
read theAbstractOrderEntryModel
by PKSearchPageData<ProductConfigurationModel>
getOrphaned(int pageSize, int currentPage)
Gets configurations that are neither related to any abstract order entry nor are related to any Product.SearchPageData<ProductConfigurationModel>
getProductRelatedByThreshold(java.lang.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)boolean
isOnlyRelatedToGivenEntry(java.lang.String configId, java.lang.String cartEntryKey)
Checks whether a configuration is linked to more than the given abstract order entry.boolean
isRelatedToAbstractOrderEntry(ProductConfigurationModel model)
Is this model related to any abstract order entry, be it draft or not?
-
-
-
Method Detail
-
getByConfigId
default ProductConfigurationModel getByConfigId(java.lang.String configId)
read theProductConfigurationModel
by configId- Parameters:
configId
- configuration id- Returns:
- product configuration persistence model
-
getByConfigId
ProductConfigurationModel getByConfigId(java.lang.String configId, boolean allowNull)
read theProductConfigurationModel
by configId- Parameters:
configId
- configuration idallowNull
- iftrue
null is returned if no configuration with the given id is found, otherwise an exception is thrown- Returns:
- n product configuration persistence model
-
getByProductCode
ProductConfigurationModel getByProductCode(java.lang.String productCode)
read theProductConfigurationModel
associated 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
ProductConfigurationModel getByProductCodeAndUser(java.lang.String productCode, UserModel user)
read allProductConfigurationModel
s currently linked to the given product and user- Parameters:
productCode
- product Codeuser
- user model- Returns:
- product configuration persistence model
-
getOrderEntryByPK
AbstractOrderEntryModel getOrderEntryByPK(java.lang.String cartEntryKey)
read theAbstractOrderEntryModel
by PK- Parameters:
cartEntryKey
- cart Entry PK- Returns:
- order entry
-
getOrderEntryByConfigId
AbstractOrderEntryModel getOrderEntryByConfigId(java.lang.String configId, boolean isDraft)
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
- iftrue
draft link will be checked, otherwise default link- Returns:
- order entry
-
getAllOrderEntriesByConfigId
java.util.List<AbstractOrderEntryModel> getAllOrderEntriesByConfigId(java.lang.String configId)
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
java.util.List<ProductConfigurationModel> getByUserSessionId(java.lang.String userSessionId)
read the list ofProductConfigurationModel
associated to the given user session id- Parameters:
userSessionId
- id of the user session- Returns:
- list of product configuration persistence models
-
getProductRelatedByThreshold
SearchPageData<ProductConfigurationModel> getProductRelatedByThreshold(java.lang.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
SearchPageData<ProductConfigurationModel> getOrphaned(int pageSize, int currentPage)
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
SearchPageData<ProductConfigurationModel> getAll(int pageSize, int currentPage)
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
boolean isOnlyRelatedToGivenEntry(java.lang.String configId, java.lang.String cartEntryKey)
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
boolean isRelatedToAbstractOrderEntry(ProductConfigurationModel model)
Is this model related to any abstract order entry, be it draft or not?- Parameters:
model
- ProductConfiguration representation in commerce persistence- Returns:
true
if and only if related to any abstract order entry model
-
-