com.ibm.commerce.promotion.facade.server.services.dataaccess.db.jdbc

Class PromotionSearchSQLComposer

  • All Implemented Interfaces:
    java.io.Serializable


    public class PromotionSearchSQLComposer
    extends SQLComposer
    The SQL composer class is used to compose the query to narrow the promotion search result by promotion type, promotion status, startDate, and endDate of the promotion.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

        public static final java.lang.String CONTROL_PARAM_PREFIX
        The Control Parameter prefix for Promotion Services.
        See Also:
        Constant Field Values
      • CONTROL_PARAM_NAME_START_DATE_DATE1

        public static final java.lang.String CONTROL_PARAM_NAME_START_DATE_DATE1
        The Control Parameter Name for Start Date if after this date.
        See Also:
        Constant Field Values
      • CONTROL_PARAM_NAME_START_DATE_DATE2

        public static final java.lang.String CONTROL_PARAM_NAME_START_DATE_DATE2
        The Control Parameter Name for Start Date is before this date.
        See Also:
        Constant Field Values
      • CONTROL_PARAM_NAME_END_DATE_DATE1

        public static final java.lang.String CONTROL_PARAM_NAME_END_DATE_DATE1
        The Control Parameter Name for End Date if after this date.
        See Also:
        Constant Field Values
      • CONTROL_PARAM_NAME_END_DATE_DATE2

        public static final java.lang.String CONTROL_PARAM_NAME_END_DATE_DATE2
        The Control Parameter Name for End Date is before this date.
        See Also:
        Constant Field Values
      • CONTROL_PARAM_NAME_PROMOTION_TYPE

        public static final java.lang.String CONTROL_PARAM_NAME_PROMOTION_TYPE
        The Control Parameter Name for the Promotion Type.
        See Also:
        Constant Field Values
      • CONTROL_PARAM_NAME_PROMOTION_STATUS

        public static final java.lang.String CONTROL_PARAM_NAME_PROMOTION_STATUS
        The Control Parameter Name for Promotion Status.
        See Also:
        Constant Field Values
      • CONTROL_PARAM_NAME_PROMOTION_REDEMPTION_METHOD

        public static final java.lang.String CONTROL_PARAM_NAME_PROMOTION_REDEMPTION_METHOD
        The Control Parameter Name for Promotion Redemption Method.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PromotionSearchSQLComposer

        public PromotionSearchSQLComposer()
    • Method Detail

      • composeSQLStatement

        public SQLComposer.SQLComposerInfo composeSQLStatement(java.lang.String sqlName,
                                                               java.lang.String entityTableName,
                                                               java.util.List resultSetInfo,
                                                               java.lang.String sqlstatement,
                                                               java.util.List params)
                                                        throws DataServiceSystemException
        This method composes an SQL statement by appending AND conditions to the WHERE clause of the given SQL statement according to the search criteria specified using the control parameters in the Get Expression.

        The control parameters supported by this method are:

        • _pro.promotionType
        • _pro.promotionStatus
        • _pro.promotionRedemptionMethod
        • _pro.startDateDate1
        • _pro.startDateDate2
        • _pro.endDateDate1
        • _pro.endDateDate2
        Based upon the control parameters that are specified, the AND conditions are constructed and appended to the WHERE clause. The following example shows a query with all the parameters.
        AND PX_PROMOTION.STATUS IN (0,1) AND PX_PROMOAUTH.PROMOTIONTYPE = 'OrderLevelPercentDiscount' AND PX_PROMOTION.STARTDATE >= '2009-12-31 00:00:00.0' AND PX_PROMOTION.STARTDATE <= '2009-01-01 00:00:00.0' AND PX_PROMOTION.TYPE = 1 AND PX_PROMOTION.CDREQUIRED = 1
        Specified by:
        composeSQLStatement in class SQLComposer
        Parameters:
        sqlName - The name of the SQL statement specified in the query template
        entityTableName - The entity table name specified in the query template
        resultSetInfo - The current resultSet information, which is a list of ResultSetData. If there is no result set information, this will an empty list and the value will never be null.
        sqlstatement - The optional SQL statement specified in the query template. This could be null if there is no SQL statement specified in the query template
        params - A list of optional parameters of type String specified in the query template. If no parameters are specified, this would be an empty list and will never be null.
        Returns:
        A structure representing the updated SQL statement, its resultSet information.
        Throws:
        DataServiceSystemException