public abstract class SQLLessOrGreaterBaseClause extends java.lang.Object implements JRClauseFunction
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
CLAUSE_TRUISM |
static java.lang.String |
EXCEPTION_MESSAGE_KEY_QUERY_LESS_GREATER_CLAUSE_DB_COLUMN_TOKEN_MISSING |
static java.lang.String |
EXCEPTION_MESSAGE_KEY_QUERY_LESS_GREATER_CLAUSE_NAME_TOKEN_MISSING |
static java.lang.String |
EXCEPTION_MESSAGE_KEY_QUERY_LESS_GREATER_CLAUSE_PARAMETER_TOKEN_MISSING |
protected static java.lang.String |
OPERATOR_GREATER |
protected static java.lang.String |
OPERATOR_GREATER_OR_EQUAL |
protected static java.lang.String |
OPERATOR_LESS |
protected static java.lang.String |
OPERATOR_LESS_OR_EQUAL |
protected static int |
POSITION_CLAUSE_ID |
protected static int |
POSITION_DB_COLUMN |
protected static int |
POSITION_PARAMETER |
Modifier | Constructor and Description |
---|---|
protected |
SQLLessOrGreaterBaseClause() |
Modifier and Type | Method and Description |
---|---|
void |
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,
java.lang.String clauseId,
java.lang.String parameterName) |
protected void |
handleLessOrGreaterOperator(java.lang.StringBuffer sBuffer,
java.lang.String clauseId)
Appends the appropriate inequality sign to the query string, depending on the clause ID value
|
public static final java.lang.String EXCEPTION_MESSAGE_KEY_QUERY_LESS_GREATER_CLAUSE_DB_COLUMN_TOKEN_MISSING
public static final java.lang.String EXCEPTION_MESSAGE_KEY_QUERY_LESS_GREATER_CLAUSE_NAME_TOKEN_MISSING
public static final java.lang.String EXCEPTION_MESSAGE_KEY_QUERY_LESS_GREATER_CLAUSE_PARAMETER_TOKEN_MISSING
protected static final int POSITION_CLAUSE_ID
protected static final int POSITION_DB_COLUMN
protected static final int POSITION_PARAMETER
protected static final java.lang.String OPERATOR_LESS
protected static final java.lang.String OPERATOR_LESS_OR_EQUAL
protected static final java.lang.String OPERATOR_GREATER
protected static final java.lang.String OPERATOR_GREATER_OR_EQUAL
protected static final java.lang.String CLAUSE_TRUISM
public void apply(JRClauseTokens clauseTokens, JRQueryClauseContext queryContext)
The method expects two clause tokens (after the ID token):
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
0 = 0
).
apply
in interface JRClauseFunction
clauseTokens
- the clause tokensqueryContext
- the query contextprotected abstract ClauseFunctionParameterHandler createParameterHandler(JRQueryClauseContext queryContext, java.lang.String clauseId, java.lang.String parameterName)
protected void handleLessOrGreaterOperator(java.lang.StringBuffer sBuffer, java.lang.String clauseId)
sBuffer
- the StringBuffer that contains the generated queryclauseId
- the clause ID© 2001-2014 TIBCO Software Inc. www.jaspersoft.com