Class SQLLessOrGreaterBaseClause
java.lang.Object
net.sf.jasperreports.engine.query.SQLLessOrGreaterBaseClause
- All Implemented Interfaces:
JRClauseFunction
- Direct Known Subclasses:
DateRangeSQLLessOrGreaterClause
,JRSqlLessOrGreaterClause
- Author:
- Sanda Zaharia (shertage@users.sourceforge.net)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final int
protected static final int
protected static final int
Fields inherited from interface net.sf.jasperreports.engine.query.JRClauseFunction
CLAUSE_FALSISM, CLAUSE_TRUISM
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(JRClauseTokens clauseTokens, JRQueryClauseContext queryContext) Creates either a LESS or a GREATER SQL clause, depending on the clause ID.protected abstract ClauseFunctionParameterHandler
createParameterHandler
(JRQueryClauseContext queryContext, String clauseId, String parameterName) protected void
handleLessOrGreaterOperator
(StringBuffer sBuffer, String clauseId) Appends the appropriate inequality sign to the query string, depending on the clause ID value
-
Field Details
-
EXCEPTION_MESSAGE_KEY_QUERY_LESS_GREATER_CLAUSE_DB_COLUMN_TOKEN_MISSING
- See Also:
-
EXCEPTION_MESSAGE_KEY_QUERY_LESS_GREATER_CLAUSE_NAME_TOKEN_MISSING
- See Also:
-
EXCEPTION_MESSAGE_KEY_QUERY_LESS_GREATER_CLAUSE_PARAMETER_TOKEN_MISSING
- See Also:
-
POSITION_CLAUSE_ID
protected static final int POSITION_CLAUSE_ID- See Also:
-
POSITION_DB_COLUMN
protected static final int POSITION_DB_COLUMN- See Also:
-
POSITION_PARAMETER
protected static final int POSITION_PARAMETER- See Also:
-
OPERATOR_LESS
- See Also:
-
OPERATOR_LESS_OR_EQUAL
- See Also:
-
OPERATOR_GREATER
- See Also:
-
OPERATOR_GREATER_OR_EQUAL
- See Also:
-
-
Constructor Details
-
SQLLessOrGreaterBaseClause
protected SQLLessOrGreaterBaseClause()
-
-
Method Details
-
apply
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 isLESS
column <= ?
if the clause ID isLESS]
column >= ?
if the clause ID isGREATER
column > ?
if the clause ID is[GREATER
0 = 0
).- Specified by:
apply
in interfaceJRClauseFunction
- Parameters:
clauseTokens
- the clause tokensqueryContext
- the query context
-
createParameterHandler
protected abstract ClauseFunctionParameterHandler createParameterHandler(JRQueryClauseContext queryContext, String clauseId, String parameterName) -
handleLessOrGreaterOperator
Appends the appropriate inequality sign to the query string, depending on the clause ID value- Parameters:
sBuffer
- the StringBuffer that contains the generated queryclauseId
- the clause ID
-