pt.jcodeutil.core.sql
Class DynamicQuery
java.lang.Object
|
+--pt.jcodeutil.core.sql.DynamicQuery
- public class DynamicQuery
- extends java.lang.Object
Title: DynamicQuery
Description: Provides a simple way of constructing SQL Queries to the database.
- Version:
- 1.0
- Author:
- Marco Samuel (samuelbb@sapo.pt)
Method Summary |
java.lang.String |
getClause()
Returns the clause that was built. |
java.lang.String |
getClause(boolean removeWhereWord,
java.lang.String andOr)
Returns the clause, depending on the parameters, that was built. |
void |
insertDirectValueIntoClause(java.lang.String value)
Inserts a direct value into the clause |
void |
insertValue(java.lang.String op,
boolean left,
java.lang.String field,
java.lang.String operation,
java.lang.String value,
boolean right)
Inserts a new clause to the already existing. |
void |
reset()
Clears the existing clause |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EQUAL
public static final java.lang.String EQUAL
NOTEQUAL
public static final java.lang.String NOTEQUAL
GREATER
public static final java.lang.String GREATER
LESS
public static final java.lang.String LESS
GREATER_OR_EQUAL
public static final java.lang.String GREATER_OR_EQUAL
LESS_OR_EQUAL
public static final java.lang.String LESS_OR_EQUAL
LEFT_BRACE
public static final java.lang.String LEFT_BRACE
RIGHT_BRACE
public static final java.lang.String RIGHT_BRACE
STAR
public static final java.lang.String STAR
NONE
public static final java.lang.String NONE
AND
public static final java.lang.String AND
OR
public static final java.lang.String OR
LIKE
public static final java.lang.String LIKE
ISNOT
public static final java.lang.String ISNOT
IS
public static final java.lang.String IS
UNION
public static final java.lang.String UNION
NULL
public static final java.lang.String NULL
COMMA
public static final java.lang.String COMMA
UNIONALL
public static final java.lang.String UNIONALL
VARCHAR2
public static final int VARCHAR2
NUMBER
public static final int NUMBER
DATE
public static final int DATE
LONG
public static final int LONG
DynamicQuery
public DynamicQuery()
- Empty constructor
getClause
public java.lang.String getClause()
- Returns the clause that was built.
- Returns:
- The clause filled until now.
getClause
public java.lang.String getClause(boolean removeWhereWord,
java.lang.String andOr)
- Returns the clause, depending on the parameters, that was built.
- Parameters:
removeWhereWord
- if true, remove the where word from the clause.andOr
- if true, add this clause in the beginning of the clause.- Returns:
- The clause that was built.
insertDirectValueIntoClause
public void insertDirectValueIntoClause(java.lang.String value)
- Inserts a direct value into the clause
- Parameters:
value
- to be inserted in the clause
insertValue
public void insertValue(java.lang.String op,
boolean left,
java.lang.String field,
java.lang.String operation,
java.lang.String value,
boolean right)
- Inserts a new clause to the already existing.
- Parameters:
op
- AND | OR | ANY conjunction for this clauseleft
- Left parenthesis existencefield
- Name of the column to be filtered in the database tableoperation
- Operation name to use in this clausevalue
- Value to test forright
- Right parenthesis existence
reset
public void reset()
- Clears the existing clause