Interface ProductConfigurationPersistenceService

    • Method Detail

      • getByConfigId

        ProductConfigurationModel getByConfigId​(java.lang.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​(java.lang.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​(java.lang.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
      • 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 id
        isDraft - 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 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​(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 - 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​(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 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