|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jasperreports.engine.query.JRSqlLessOrGreaterClause
public class JRSqlLessOrGreaterClause
Base LESS/GREATER clause function for SQL queries.
The first token in the $X{...} syntax is the function ID token. Possible values for the LESS | GREATER clause function ID token are:
LESS - in this case the LESS THAN operator < will be applied.LESS] - in this case the LESS OR EQUAL operator <= will be applied.GREATER - in this case the GREATER THAN operator > will be applied.[GREATER - in this case the GREATER OR EQUAL operator >= will be applied.
| Field Summary | |
|---|---|
protected static String |
CLAUSE_TRUISM
|
protected static String |
OPERATOR_GREATER
|
protected static String |
OPERATOR_GREATER_OR_EQUAL
|
protected static String |
OPERATOR_LESS
|
protected static String |
OPERATOR_LESS_OR_EQUAL
|
protected static int |
POSITION_CLAUSE_ID
|
protected static int |
POSITION_DB_COLUMN
|
protected static int |
POSITION_PARAMETER
|
protected static JRSqlLessOrGreaterClause |
singleton
|
| Constructor Summary | |
|---|---|
JRSqlLessOrGreaterClause()
|
|
| Method Summary | |
|---|---|
void |
apply(JRClauseTokens clauseTokens,
JRQueryClauseContext queryContext)
Creates either a LESS or a GREATER SQL clause, depending on the clause ID. |
protected void |
handleLessOrGreaterOperator(StringBuffer sBuffer,
String clauseId)
Appends the appropriate inequality sign to the query string, depending on the clause ID value |
static JRSqlLessOrGreaterClause |
instance()
Returns the singleton function instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int POSITION_CLAUSE_ID
protected static final int POSITION_DB_COLUMN
protected static final int POSITION_PARAMETER
protected static final String OPERATOR_LESS
protected static final String OPERATOR_LESS_OR_EQUAL
protected static final String OPERATOR_GREATER
protected static final String OPERATOR_GREATER_OR_EQUAL
protected static final String CLAUSE_TRUISM
protected static final JRSqlLessOrGreaterClause singleton
| Constructor Detail |
|---|
public JRSqlLessOrGreaterClause()
| Method Detail |
|---|
public static JRSqlLessOrGreaterClause instance()
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 LESScolumn <= ? if the clause ID is LESS]column >= ? if the clause ID is GREATERcolumn > ? if the clause ID is [GREATER0 = 0).
apply in interface JRClauseFunctionclauseTokens - the clause tokensqueryContext - the query context
protected void handleLessOrGreaterOperator(StringBuffer sBuffer,
String clauseId)
sBuffer - the StringBuffer that contains the generated queryclauseId - the clause ID
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||