|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectwave.persist.constraints.Constraint | +--com.objectwave.persist.constraints.ConstraintCompare
The constraint object to handle the following comparison capabilities. "LIKE", "MATCHES", "=", "!=", "<", ">=", ">", "<=" .
Field Summary | |
static int |
equalsIndex
Description of the Field |
static int |
greaterOrEqualIndex
Description of the Field |
static int |
greaterThanIndex
Description of the Field |
static int |
lessOrEqualIndex
Description of the Field |
static int |
lessThanIndex
Description of the Field |
static int |
likeIndex
Description of the Field |
static int |
matchesIndex
Description of the Field |
static int |
notEqualsIndex
Description of the Field |
Fields inherited from class com.objectwave.persist.constraints.Constraint |
columnName, defaultObjectFormatter, objectFormatter |
Constructor Summary | |
ConstraintCompare()
|
Method Summary | |
boolean |
checkConstraint(java.lang.Object fieldObj,
java.lang.Object queryObj)
Check to see if a given object passes this constraint. |
java.lang.String |
constructQueryString()
Return the string which will appear in the query string. |
protected boolean |
dateCompare(java.util.Date fDate,
java.util.Date rDate,
java.lang.String comp)
Compare the two dates with the specified comparison operation. |
void |
fromString(java.lang.String str)
Parse the string. |
java.lang.String |
getComparison()
|
int |
getComparisonIndex()
|
static java.lang.String[] |
getComparisons()
|
java.lang.String |
getCompValue()
|
static java.util.Vector |
getFields()
|
java.util.Enumeration |
getStaticList()
Gets the StaticList attribute of the Constraint object |
java.lang.String |
getType()
This is a unique, readable string identifying the constraint type (ex, anyof, null) |
boolean |
isComparisonValueFromPersistentObject()
|
void |
setComparison(int index)
|
void |
setComparison(java.lang.String comp)
|
void |
setCompValue(java.lang.String val)
Sets the CompValue attribute of the ConstraintCompare object |
protected java.lang.String |
sqlCompValue()
|
void |
staticListInsert(java.lang.String field)
Each type of constraint will have a specific set of fields associated with it. |
protected boolean |
stringCompare(java.lang.String fStr,
java.lang.String rStr,
java.lang.String comp)
Compare the two strings with the specified comparison operation. |
java.lang.String |
stringify()
A nice display version of the object. |
Methods inherited from class com.objectwave.persist.constraints.Constraint |
checkConstraint, classOfField, clone, equals, findField, formatString, getColumnName, getField, getNot, getObjectFormatter, getPersistence, isUsingColumnName, setColumnName, setField, setNot, setObjectFormatter, setPersistence, sqlString, stringToObject, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int likeIndex
public static final int matchesIndex
public static final int equalsIndex
public static final int notEqualsIndex
public static final int lessThanIndex
public static final int greaterOrEqualIndex
public static final int greaterThanIndex
public static final int lessOrEqualIndex
Constructor Detail |
public ConstraintCompare()
Method Detail |
public static java.lang.String[] getComparisons()
public static java.util.Vector getFields()
public void setComparison(int index)
index
- The new Comparison valuepublic void setComparison(java.lang.String comp)
comp
- The new Comparison valuepublic void setCompValue(java.lang.String val)
val
- The new CompValue valuepublic java.lang.String getComparison()
public int getComparisonIndex()
public java.lang.String getCompValue()
public java.util.Enumeration getStaticList()
Constraint
getStaticList
in class Constraint
public java.lang.String getType()
Constraint
getType
in class Constraint
public boolean isComparisonValueFromPersistentObject()
isComparisonValueFromPersistentObject
in class Constraint
public boolean checkConstraint(java.lang.Object fieldObj, java.lang.Object queryObj)
Constraint
checkConstraint
in class Constraint
fieldObj
- java.lang.Object The value being compared.queryObj
- java.lang.Object
public java.lang.String constructQueryString()
Constraint
constructQueryString
in class Constraint
public void fromString(java.lang.String str) throws java.text.ParseException
Constraint
fromString
in class Constraint
str
- Description of Parameter
java.text.ParseException
- Description of Exceptionpublic void staticListInsert(java.lang.String field)
Constraint
staticListInsert
in class Constraint
field
- Description of Parameterpublic java.lang.String stringify()
stringify
in class Constraint
protected boolean dateCompare(java.util.Date fDate, java.util.Date rDate, java.lang.String comp)
fDate
- The left hand argument to the comparisonrDate
- The right hand argument to the comparisoncomp
- The comparison type. ex. '=', ' <=', etc...
protected boolean stringCompare(java.lang.String fStr, java.lang.String rStr, java.lang.String comp)
fStr
- The left hand argument to the comparisonrStr
- The right hand argument to the comparisoncomp
- The comparison type. ex. '=', ' <=', etc...
protected java.lang.String sqlCompValue() throws java.lang.NoSuchFieldException, java.lang.NumberFormatException, java.text.ParseException, java.io.IOException
java.lang.NoSuchFieldException
- Description of Exception
java.lang.NumberFormatException
- Description of Exception
java.text.ParseException
- Description of Exception
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |