|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.pow2.dao.Condition
Utility class for build query conditions.
Field Summary | |
static String |
AND
and boolean operator |
protected org.apache.log4j.Category |
cat
Log4J category |
static String |
EMPTY
empty string |
static String |
EQUAL
equal operator |
static String |
LIKE
like operator |
static String |
NOT_EQUAL
not equal operator |
static String |
NOT_LIKE
not like operator |
static String |
NULL
null |
static String |
OR
or boolean operator |
Constructor Summary | |
Condition()
Default constructor. |
|
Condition(String attributeName,
String op,
String attributeValue,
boolean encloseInBrackets)
Constructor. |
Method Summary | |
Condition |
add(String booleanOp,
Condition cnd,
boolean encloseInBrackets)
Add the input Condition object to the current condition. |
Condition |
add(String attributeName,
String op,
String attributeValue,
boolean encloseInBrackets)
Add a condition to the global WHERE clause. |
Condition |
add(String booleanOp,
String attributeName,
String op,
String attributeValue,
boolean encloseInBrackets)
Add a condition to the global WHERE clause. |
void |
clear()
Clear the internal condition string. |
Condition |
encloseInBrackets()
Enclose the input condition in brackets |
boolean |
isEmpty()
Test if the condition is empty |
String |
toString()
Get the string representation of the current condition. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected org.apache.log4j.Category cat
public static final String EQUAL
public static final String NOT_EQUAL
public static final String LIKE
public static final String NOT_LIKE
public static final String AND
public static final String OR
public static final String EMPTY
public static final String NULL
Constructor Detail |
public Condition()
public Condition(String attributeName, String op, String attributeValue, boolean encloseInBrackets)
attributeName
- the name of the element used by the binary operator op
op
- the binary operator that binds the attributeValue to the attributeName.attributeValue
- the value bond to the input attributeencloseInBrackets
- true if the resulting condition statements must be enclosed
in brackets; false otherwiseMethod Detail |
public Condition add(String booleanOp, Condition cnd, boolean encloseInBrackets)
booleanOp
- the boolean operator used to bind the input condition object
with the current conditioncnd
- the input Condition object to add to the current conditionencloseInBrackets
- true if the resulting condition statements must be enclosed
in brackets; false otherwise
public Condition add(String attributeName, String op, String attributeValue, boolean encloseInBrackets)
attributeName
- the name of the element used by the binary operator op
op
- the binary operator that binds the attributeValue to the attributeName.
attributeValue
- the value bond to the input attributeencloseInBrackets
- true if the resulting condition statements must be enclosed
in brackets; false otherwise
public Condition add(String booleanOp, String attributeName, String op, String attributeValue, boolean encloseInBrackets)
booleanOp
- the boolean operator that adds this condition statement
to the previous condition statement (if any) of the
the global WHERE clause
attributeName
- the name of the element used by the binary operator op
op
- the binary operator that binds the attributeValue to the attributeName.
attributeValue
- the value bond to the input attribute
public void clear()
public boolean isEmpty()
public String toString()
public Condition encloseInBrackets()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |