Class SQLLessOrGreaterBaseClause

    • Constructor Detail

      • SQLLessOrGreaterBaseClause

        protected SQLLessOrGreaterBaseClause()
    • Method Detail

      • apply

        public void apply​(JRClauseTokens clauseTokens,
                          JRQueryClauseContext queryContext)
        Creates either a LESS or a GREATER SQL clause, depending on the clause ID.

        The method expects two clause tokens (after the ID token):

        • The first token is the SQL column (or column combination) to be used in the clause.
        • The second token is the name of the report parameter that contains the value to compare to.

        The method constructs one of the following clauses:

        • column < ? if the clause ID is LESS
        • column <= ? if the clause ID is LESS]
        • column >= ? if the clause ID is GREATER
        • column > ? if the clause ID is [GREATER
        If the value to compare to is null, the method generates a SQL clause that will always evaluate to true (e.g. 0 = 0).

        Specified by:
        apply in interface JRClauseFunction
        Parameters:
        clauseTokens - the clause tokens
        queryContext - the query context
      • handleLessOrGreaterOperator

        protected void handleLessOrGreaterOperator​(StringBuffer sBuffer,
                                                   String clauseId)
        Appends the appropriate inequality sign to the query string, depending on the clause ID value
        Parameters:
        sBuffer - the StringBuffer that contains the generated query
        clauseId - the clause ID