com.ibm.commerce.price.rule.runtime.persistence

Class PriceRulePersistenceManager

  • java.lang.Object
    • com.ibm.commerce.price.rule.runtime.persistence.PriceRulePersistenceManager


  • public class PriceRulePersistenceManager
    extends java.lang.Object
    The price rule persistence manager is used to access database to retrieve price rule as well as price element and price element attributes.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void deleteAllElementAttrByElementId(java.lang.String elementId)
      Delete all element attributes by element id.
      static void deleteElementChildrenByPriceRuleAndParentElement(java.lang.String aPriceRuleId, java.lang.String aParentElementIdentifier)
      This method deletes the children of specific element.
      static com.ibm.commerce.price.rule.runtime.objects.PriceRuleElementObject[] findChildrenElementByPriceRuleAndParent(java.lang.String priceRuleId, java.lang.String parentElementName)
      Find the children elements by price rule id and parent element name.
      static java.util.List findElementAttrListByElementId(java.lang.String elementId)
      Find element attribute list by element id.
      static java.util.Map findElementAttrMapByElementId(java.lang.String elementId)
      Find the element attribute map by element id.
      static com.ibm.commerce.price.rule.runtime.objects.PriceRuleElementObject findElementById(java.lang.String elementId)
      Find element by the id.
      static com.ibm.commerce.price.facade.server.entity.datatypes.Preletemplate findElementFormatById(java.lang.String elementTypeId)
      Get price rule element template physical SDO by element id.
      static java.lang.Long findElementFormatByNameAndType(java.lang.String elementFormatName, java.lang.String formatGroup)
      Get price rule element template physical SDO by element template name and template group name.
      static java.lang.String findElementIdByNameAndPriceRule(java.lang.String elementName, java.lang.String priceRuleId)
      This method gets the unique id of a price rule element based on the name of the element and the price rule unique id.
      static com.ibm.commerce.price.rule.runtime.objects.PriceRuleObject findPriceRuleById(java.lang.String priceRuleId)
      Find the price rule by the price rule id.
      static com.ibm.commerce.price.rule.runtime.objects.PriceRuleObject findPriceRuleByNameAndStore(java.lang.String priceRuleName)
      Find price rule by name and store.
      static com.ibm.commerce.price.rule.runtime.objects.PriceRuleObject findPriceRuleByNameAndStorePath(java.lang.String priceRuleName)
      Find price rule by name and store path.
      static com.ibm.commerce.price.rule.runtime.objects.PriceRuleElementObject findRootElementByPriceRule(java.lang.String priceRuleId)
      Find the root element by price rule id.
      static com.ibm.commerce.price.facade.server.entity.datatypes.Prelement getElement(PhysicalDataContainer pdc, java.lang.String elementId)
      Get price rule element physical SDO by pdc and element id.
      static PhysicalDataContainer getElementContainer(java.lang.String elementId)
      Get element container by element id.
      static com.ibm.commerce.price.facade.server.entity.datatypes.Pricerule getPriceRule(PhysicalDataContainer pdc, java.lang.String priceRuleId)
      Get the price rule physical SDO by pdc and price rule id.
      static PhysicalDataContainer getPriceRuleContainer(java.lang.String priceRuleId)
      Get the price rule container.
      static PhysicalDataContainer getPriceRuleContainerByName(java.lang.String priceRuleName)
      Get price rule container by price rule name.
      static com.ibm.commerce.price.rule.runtime.objects.PriceRuleElementObject populateElementFromSDO(com.ibm.commerce.price.facade.server.entity.datatypes.Prelement prelement)
      Populate element object by physical SDO.
      static void updatePriceRuleLastUpdate(java.lang.String priceRuleId)
      This method is called by the mediators to update the LastUpdateTime of a price rule.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PriceRulePersistenceManager

        public PriceRulePersistenceManager()
    • Method Detail

      • findPriceRuleById

        public static com.ibm.commerce.price.rule.runtime.objects.PriceRuleObject findPriceRuleById(java.lang.String priceRuleId)
                                                                                             throws DataMediatorException
        Find the price rule by the price rule id.
        Parameters:
        priceRuleId - The id of price rule. It can't be null or empty.
        Returns:
        The price rule object.This value will be null if no price rule found.
        Throws:
        DataMediatorException
      • getPriceRuleContainer

        public static PhysicalDataContainer getPriceRuleContainer(java.lang.String priceRuleId)
                                                           throws DataMediatorException
        Get the price rule container.
        Parameters:
        priceRuleId - The id of price rule. It can't be null or empty.
        Returns:
        The physical data container. This value will be null if no container found.
        Throws:
        DataMediatorException
      • getPriceRuleContainerByName

        public static PhysicalDataContainer getPriceRuleContainerByName(java.lang.String priceRuleName)
                                                                 throws DataMediatorException
        Get price rule container by price rule name.
        Parameters:
        priceRuleName - The name of price rule. It can't be null or empty.
        Returns:
        The physical data container. This value will be null if no container found.
        Throws:
        DataMediatorException
      • getPriceRule

        public static com.ibm.commerce.price.facade.server.entity.datatypes.Pricerule getPriceRule(PhysicalDataContainer pdc,
                                                                                                   java.lang.String priceRuleId)
                                                                                            throws DataMediatorException
        Get the price rule physical SDO by pdc and price rule id.
        Parameters:
        pdc - The physical data container. It can't be null.
        priceRuleId - The id of price rule. It can't be null or empty.
        Returns:
        The price rule. This value will be null if no price rule found.
        Throws:
        DataMediatorException
      • findElementById

        public static com.ibm.commerce.price.rule.runtime.objects.PriceRuleElementObject findElementById(java.lang.String elementId)
                                                                                                  throws DataMediatorException
        Find element by the id.
        Parameters:
        elementId - The id of element. It can't be null or empty.
        Returns:
        The price rule element object. This value will be null if no price rule element found.
        Throws:
        DataMediatorException
      • getElementContainer

        public static PhysicalDataContainer getElementContainer(java.lang.String elementId)
                                                         throws DataMediatorException
        Get element container by element id.
        Parameters:
        elementId - The id of element. It can't be null or empty.
        Returns:
        The physical data container. This value will be null if no container found.
        Throws:
        DataMediatorException
      • getElement

        public static com.ibm.commerce.price.facade.server.entity.datatypes.Prelement getElement(PhysicalDataContainer pdc,
                                                                                                 java.lang.String elementId)
                                                                                          throws DataMediatorException
        Get price rule element physical SDO by pdc and element id.
        Parameters:
        pdc -
        elementId - The id of element. It can't be null or empty.
        Returns:
        The price rule element physical SDO. This value will be null if no objects found.
        Throws:
        DataMediatorException
      • findElementIdByNameAndPriceRule

        public static java.lang.String findElementIdByNameAndPriceRule(java.lang.String elementName,
                                                                       java.lang.String priceRuleId)
        This method gets the unique id of a price rule element based on the name of the element and the price rule unique id.
        Parameters:
        elementName - The name of a price rule element. It can't be null or empty.
        priceRuleId - The id of the price rule associated with the element. It can't be null or empty.
        Returns:
        This method returns the unique id of the price rule element. This value will be null if no objects found.
      • findElementFormatById

        public static com.ibm.commerce.price.facade.server.entity.datatypes.Preletemplate findElementFormatById(java.lang.String elementTypeId)
                                                                                                         throws DataMediatorException
        Get price rule element template physical SDO by element id.
        Parameters:
        elementTypeId - The element template id. It can't be null or empty.
        Returns:
        The price rule element template physical SDO. This value will be null if no objects found.
        Throws:
        DataMediatorException
      • findElementFormatByNameAndType

        public static java.lang.Long findElementFormatByNameAndType(java.lang.String elementFormatName,
                                                                    java.lang.String formatGroup)
                                                             throws DataMediatorException
        Get price rule element template physical SDO by element template name and template group name.
        Parameters:
        elementFormatName - The name of element template. It can't be null or empty.
        formatGroup - The template group of element. It can't be null or empty.
        Returns:
        The template id for the element. This value will be null if no objects found.
        Throws:
        DataMediatorException
      • findElementAttrMapByElementId

        public static java.util.Map findElementAttrMapByElementId(java.lang.String elementId)
                                                           throws DataMediatorException
        Find the element attribute map by element id.
        Parameters:
        elementId - The id of element. It can't be null or empty.
        Returns:
        The element attribute map. This value will be null if no objects found.
        Throws:
        DataMediatorException
      • findElementAttrListByElementId

        public static java.util.List findElementAttrListByElementId(java.lang.String elementId)
                                                             throws DataMediatorException
        Find element attribute list by element id.
        Parameters:
        elementId - The id of price rule. It can't be null or empty.
        Returns:
        The element attribute list. This value will be null if no objects found.
        Throws:
        DataMediatorException
      • deleteAllElementAttrByElementId

        public static void deleteAllElementAttrByElementId(java.lang.String elementId)
                                                    throws DataMediatorException
        Delete all element attributes by element id.
        Parameters:
        elementId - The id of price rule. It can't be null or empty.
        Throws:
        DataMediatorException
      • findPriceRuleByNameAndStore

        public static com.ibm.commerce.price.rule.runtime.objects.PriceRuleObject findPriceRuleByNameAndStore(java.lang.String priceRuleName)
                                                                                                       throws DataMediatorException
        Find price rule by name and store.
        Parameters:
        priceRuleName - The name of price rule. It can't be null or empty.
        Returns:
        The price rule object. This value will be null if no objects found.
        Throws:
        DataMediatorException
      • findPriceRuleByNameAndStorePath

        public static com.ibm.commerce.price.rule.runtime.objects.PriceRuleObject findPriceRuleByNameAndStorePath(java.lang.String priceRuleName)
                                                                                                           throws DataMediatorException
        Find price rule by name and store path.
        Parameters:
        priceRuleName - The name of price rule. It can't be null or empty.
        Returns:
        The price rule object. This value will be null if no objects found.
        Throws:
        DataMediatorException
      • findRootElementByPriceRule

        public static com.ibm.commerce.price.rule.runtime.objects.PriceRuleElementObject findRootElementByPriceRule(java.lang.String priceRuleId)
                                                                                                             throws DataMediatorException
        Find the root element by price rule id.
        Parameters:
        priceRuleId - The id of price rule. It can't be null or empty.
        Returns:
        The root price element object. This value will be null if no objects found.
        Throws:
        DataMediatorException
      • findChildrenElementByPriceRuleAndParent

        public static com.ibm.commerce.price.rule.runtime.objects.PriceRuleElementObject[] findChildrenElementByPriceRuleAndParent(java.lang.String priceRuleId,
                                                                                                                                   java.lang.String parentElementName)
                                                                                                                            throws DataMediatorException
        Find the children elements by price rule id and parent element name.
        Parameters:
        priceRuleId - The id of price rule. It can't be null or empty.
        parentElementName - The name of parent element. It can't be null or empty.
        Returns:
        The children elements. This value will be null if no objects found.
        Throws:
        DataMediatorException
      • populateElementFromSDO

        public static com.ibm.commerce.price.rule.runtime.objects.PriceRuleElementObject populateElementFromSDO(com.ibm.commerce.price.facade.server.entity.datatypes.Prelement prelement)
                                                                                                         throws DataMediatorException
        Populate element object by physical SDO.
        Parameters:
        prelement - The element physical SDO. It can't be null.
        Returns:
        The price rule element object. This value will be null if SDO is null.
        Throws:
        DataMediatorException
      • deleteElementChildrenByPriceRuleAndParentElement

        public static void deleteElementChildrenByPriceRuleAndParentElement(java.lang.String aPriceRuleId,
                                                                            java.lang.String aParentElementIdentifier)
        This method deletes the children of specific element.
        Parameters:
        aPriceRuleId - The price rule id. It can't be null.
        aParentElementIdentifier - The element identifier. It can't be null.
      • updatePriceRuleLastUpdate

        public static void updatePriceRuleLastUpdate(java.lang.String priceRuleId)
                                              throws DataMediatorException
        This method is called by the mediators to update the LastUpdateTime of a price rule.
        Parameters:
        priceRuleId - The ID of the price rule. It can't be null or empty.
        Throws:
        DataMediatorException