com.ibm.commerce.tools.campaigns.search

Class CollateralSearchUtility

  • java.lang.Object
    • com.ibm.commerce.tools.campaigns.search.CollateralSearchUtility
    • Field Detail

      • COPYRIGHT

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

      • CollateralSearchUtility

        public CollateralSearchUtility()
        Default constructor of this class.
    • Method Detail

      • addResultAttribute

        public void addResultAttribute(int resultAttribute)
                                throws java.lang.Exception
        This method adds result set to Select clause.
        Parameters:
        resultAttribute - The static integer constants equivalent to result column. The column constants are defined in interface CollateralSearchUtilityConstants.
        Throws:
        java.lang.Exception
      • addSelectAttribute

        public void addSelectAttribute(int attribute,
                                       int operator)
                                throws java.lang.Exception
        Adds a predicate to query Where clause, example, TABLE.COLUMN IS NOT NULL.
        Parameters:
        attribute - The static integer constant equivalent of a column name. The column constants are defined in interface CollateralSearchUtilityConstants.
        operator - The static integer constant equivalent of an operator. The column constants are defined in interface CollateralSearchUtilityConstants.
        Throws:
        java.lang.Exception
      • addSelectAttribute

        public void addSelectAttribute(int attribute,
                                       int operator,
                                       int function)
                                throws java.lang.Exception
        Adds a predicate to query Where clause, example FUNCTION(TABLE.COLUMN) IS NULL.
        Parameters:
        attribute - The static integer constant equivalent of a column name. The column constants are defined in interface CollateralSearchUtilityConstants.
        operator - The static integer constant equivalent of an operator. The column constants are defined in interface CollateralSearchUtilityConstants.
        function - The static integer constant equivalent of a function. At present only UPPER function is supported.
        Throws:
        java.lang.Exception
      • addSelectAttribute

        public void addSelectAttribute(int attribute,
                                       int operator,
                                       java.lang.String value)
                                throws java.lang.Exception
        Adds a predicate to query Where clause, example, TABLE.COLUMN LIKE '%VALUE%'.
        Parameters:
        attribute - The static integer constant equivalent of a column name. The column constants are defined in interface CollateralSearchUtilityConstants.
        operator - The static integer constant equivalent of an operator. The column constants are defined in interface CollateralSearchUtilityConstants.
        value - The value to be filtered from the database.
        Throws:
        java.lang.Exception
      • addSelectAttribute

        public void addSelectAttribute(int attribute,
                                       int operator,
                                       java.lang.String value,
                                       int function)
                                throws java.lang.Exception
        Adds a predicate to query Where clause, example FUNCTION(TABLE.COLUMN) LIKE '%VALUE%'. This method will use compliment of specified operator. For example if the operator is LIKE then this method converts it to NOTLIKE.
        Parameters:
        attribute - The static integer constant equivalent of a column name.
        operator - The static integer constant equivalent of an operator. The column constants are defined in interface CollateralSearchUtilityConstants.
        value - The value to be filtered from the database.
        function - The static integer constant equivalent of a function. At present only UPPER function is supported.
        Throws:
        java.lang.Exception
      • addSelectOperand

        public void addSelectOperand(com.ibm.commerce.search.base.Attribute attr)
                              throws java.lang.Exception
        Adds a WHERE clause predicate into temporary select set predicate collection.
        Parameters:
        attr - A WHERE clause predicate.
        Throws:
        java.lang.Exception
      • addSelectOperand

        public void addSelectOperand(com.ibm.commerce.search.base.Predicate predicate)
                              throws java.lang.Exception
        Adds a collection of WHERE clause predicates into temporary select set predicate collection.
        Parameters:
        predicate - A collection of predicates.
        Throws:
        java.lang.Exception
      • addSelectOperator

        public void addSelectOperator(int operator)
        This method adds operator to the Where clause. The logic for post-fix resides in this method.
        Parameters:
        operator - The static integer constant equivalent of an operator. The operator constants are defined in interface CollateralSearchUtilityConstants.
      • addOrderByAttribute

        public void addOrderByAttribute(int attribute,
                                        int operator)
                                 throws java.lang.Exception
        To set order by operator.
        Parameters:
        attribute - The static integer constant equivalent of an column. The column constants are defined in interface CollateralSearchUtilityConstants.
        operator - The static integer constant equivalent of an ASC or DESC operator. The column constants are defined in interface CollateralSearchUtilityConstants.
        Throws:
        java.lang.Exception
      • addJoinAttribute

        public com.ibm.commerce.search.base.Attribute addJoinAttribute(int attribute1,
                                                                       int operator,
                                                                       int attribute2)
                                                                throws java.lang.Exception
        Adds a join predicate to query Where clause, example TABLE.COLUMN = TABLE.COLUMN.
        Parameters:
        attribute1 - The static integer constant equivalent of a column name. The column constants are defined in interface CollateralSearchUtilityConstants.
        operator - The static integer constant equivalent of an operator. The column constants are defined in interface CollateralSearchUtilityConstants.
        attribute2 - The static integer constant equivalent of a column name. The column constants are defined in interface CollateralSearchUtilityConstants.
        Returns:
        Attribute object that contains a JOIN predicate
        Throws:
        java.lang.Exception
      • execute

        public java.util.Vector execute(com.ibm.commerce.base.objects.Cursor aCursor)
                                 throws java.lang.Exception
        Executes query and retrieves a set of results as mentioned in Cursor object.
        Parameters:
        aCursor - The cursor object.
        Returns:
        A collection of result set as specified in the cursor object.
        Throws:
        java.lang.Exception
      • execute

        public java.util.Vector execute()
                                 throws java.lang.Exception
        Executes query and retrieves a result set.
        Returns:
        A collection of all the results.
        Throws:
        java.lang.Exception
      • setLanguageId

        public void setLanguageId(java.lang.Integer i)
        To set language ID. Commands using this utility must set this if language ID is to be added.
        Parameters:
        i - Language ID.
      • getAttrClassName

        public java.lang.String getAttrClassName()
        Gets the instance variable used in findAttributeInfoName.
        Returns:
        Instance variable used in findAttributeInfoName.
      • setAttrClassName

        public void setAttrClassName(java.lang.String attrClassNam)
        Sets the instance variable used in findAttributeInfoName.
        Parameters:
        attrClassNam - Instance variable used in findAttributeInfoName.
      • getJoinHash

        public java.util.HashMap getJoinHash()
        Gets the Join predicate dictionary.
        Returns:
        Join predicate dictionary.
      • setJoinHash

        public void setJoinHash(java.util.HashMap map)
        Sets the Join predicate dictionary.
        Parameters:
        map - Join predicate dictionary.