Interface ProductConfigurationPersistenceService

All Known Implementing Classes:
ProductConfigurationPersistenceServiceImpl

public interface ProductConfigurationPersistenceService
Service to retrieve ProductConfigurationModels from the persistence.
  • Method Details

    • getByConfigId

      default ProductConfigurationModel getByConfigId(String configId)
      read the ProductConfigurationModel by configId
      Parameters:
      configId - configuration id
      Returns:
      product configuration persistence model
    • getByConfigId

      ProductConfigurationModel getByConfigId(String configId, boolean allowNull)
      read the ProductConfigurationModel by configId
      Parameters:
      configId - configuration id
      allowNull - if true 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(String productCode)
      read the ProductConfigurationModel 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(String productCode, UserModel user)
      read all ProductConfigurationModels currently linked to the given product and user
      Parameters:
      productCode - product Code
      user - user model
      Returns:
      product configuration persistence model
    • getOrderEntryByPK

      AbstractOrderEntryModel getOrderEntryByPK(String cartEntryKey)
      Parameters:
      cartEntryKey - cart Entry PK
      Returns:
      order entry
    • getOrderEntryByConfigId

      AbstractOrderEntryModel getOrderEntryByConfigId(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 id
      isDraft - iftrue draft link will be checked, otherwise default link
      Returns:
      order entry
    • getAllOrderEntriesByConfigId

      List<AbstractOrderEntryModel> getAllOrderEntriesByConfigId(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

      List<ProductConfigurationModel> getByUserSessionId(String userSessionId)
      read the list of ProductConfigurationModel 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(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 - threshold
      pageSize - max number of models to be read within one invocation
      currentPage - 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 invocation
      currentPage - 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 invocation
      currentPage - page idx to read
      Returns:
      List of product configuration persistence models
    • isOnlyRelatedToGivenEntry

      boolean isOnlyRelatedToGivenEntry(String configId, String cartEntryKey)
      Checks whether a configuration is linked to more than the given abstract order entry.
      Parameters:
      configId - config id to check
      cartEntryKey - 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