net.sf.jasperreports.engine.query

## Class JRSqlAbstractEqualClause

- java.lang.Object
- - net.sf.jasperreports.engine.query.JRSqlAbstractEqualClause

- All Implemented Interfaces:
    JRClauseFunction
  Direct Known Subclasses:
    JRSqlEqualClause, JRSqlNotEqualClause

      public abstract class JRSqlAbstractEqualClause
      extends java.lang.Object
      implements JRClauseFunction

  Base (NOT) EQUAL clause function for SQL queries.

  The first token in the $X{...} syntax is the function ID token. Possible values for the (NOT) EQUAL clause function ID token are:

  - EQUAL
  - NOTEQUAL
  Version:
    $Id: JRSqlAbstractEqualClause.java 5878 2013-01-07 20:23:13Z teodord $
  Author:
    sanda zaharia (shertage@users.sourceforge.net)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `POSITION_DB_COLUMN`
    `static int` | `POSITION_PARAMETER`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `JRSqlAbstractEqualClause()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `apply(JRClauseTokens clauseTokens, JRQueryClauseContext queryContext)` Creates a (NOT) EQUAL SQL clause.
    `protected void` | `finalizeClause(java.lang.StringBuffer sbuffer, java.lang.String param, JRQueryClauseContext queryContext)` Finalizes the query string
    `protected abstract void` | `handleEqualOperator(java.lang.StringBuffer sBuffer, java.lang.String param, JRQueryClauseContext queryContext)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### POSITION_DB_COLUMN

          public static final int POSITION_DB_COLUMN

      See Also:
        Constant Field Values

    - #### POSITION_PARAMETER

          public static final int POSITION_PARAMETER

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### JRSqlAbstractEqualClause

          protected JRSqlAbstractEqualClause()

  - ### Method Detail

    - #### apply

          public void apply(JRClauseTokens clauseTokens,
                   JRQueryClauseContext queryContext)

      Creates a (NOT) EQUAL SQL clause.

      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 EQUAL function constructs either a `column = ?` or an `column IS NULL` clause, depending on the parameter's value.

      The NOTEQUAL function constructs either a `column <> ?` or an `column IS NOT NULL` clause, depending on the parameter's value.

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

    - #### finalizeClause

          protected void finalizeClause(java.lang.StringBuffer sbuffer,
                            java.lang.String param,
                            JRQueryClauseContext queryContext)

      Finalizes the query string
      Parameters:
        `sbuffer` -
        `param` -
        `queryContext` -

    - #### handleEqualOperator

          protected abstract void handleEqualOperator(java.lang.StringBuffer sBuffer,
                                 java.lang.String param,
                                 JRQueryClauseContext queryContext)

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com