|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.torque.criteria.Criterion
public class Criterion
Describes one or more where clause parts in the Criteria. Either the parts list is not null and represents this criterion or the column, value, comparison and ignoreStringCase columns are not null and represent this criterion.
Field Summary | |
---|---|
static String |
AND
Constant for the operator " AND ". |
static String |
OR
Constant for the operator " OR ". |
Constructor Summary | |
---|---|
Criterion(Criterion toCopy)
Creates a shallow copy of the given Criterion. |
|
Criterion(Object lValue,
Object rValue)
Create a new instance without verbatim sql, using equals as comparison operator. |
|
Criterion(Object lValue,
Object rValue,
SqlEnum comparison)
Create a new instance without verbatim sql. |
|
Criterion(Object lValue,
Object rValue,
SqlEnum comparison,
String sql,
Object[] preparedStatementReplacements)
Create a new instance. |
Method Summary | |
---|---|
Criterion |
and(Criterion criterion)
Replaces this criterion's condition with (this criterion's condition AND criterion). |
void |
appendTo(StringBuilder sb)
Appends a debug String representation of the Criterion onto the String builder. |
boolean |
equals(Object obj)
This method checks another Criteria.Criterion to see if they contain the same attributes. |
SqlEnum |
getComparison()
Get the comparison. |
String |
getConjunction()
Returns the conjunction for the parts of this criterion |
Object |
getLValue()
Get the left hand side value of the comparison. |
List<Criterion> |
getParts()
Returns the parts of which this criterion consists. |
Object[] |
getPreparedStatementReplacements()
Returns the prepared statement replacements for a verbatim sql condition. |
Object |
getRValue()
Get the right hand side value of the comparison. |
String |
getSql()
Returns the verbatim sql for this condition. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isComposite()
Returns whether this criterion is a composite criterion. |
boolean |
isIgnoreCase()
Is ignore case on or off? |
boolean |
isVerbatimSqlCondition()
Returns whether this Criterion represents a verbatim sql condition. |
Criterion |
or(Criterion criterion)
Replaces this criterion's condition with (this criterion's condition OR criterion). |
Criterion |
setIgnoreCase(boolean b)
Sets ignore case. |
void |
setLValue(Object lValue)
Set the left hand side value of the comparison. |
void |
setRValue(Object rValue)
Set the right hand side value of the comparison. |
String |
toString()
Build a string representation of the Criterion for debug purposes. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String AND
public static final String OR
Constructor Detail |
---|
public Criterion(Object lValue, Object rValue, SqlEnum comparison, String sql, Object[] preparedStatementReplacements)
lValue
- the left hand side value of the comparison.
If this value should be a value from the database,
the object must implement the
org.apache.torque.Column
interface.rValue
- the right hand side value of the comparison.
If this value should be a value from the database,
the object must implement the
org.apache.torque.Column
interface.comparison
- The comparison operator. Either this parameter or
sql must be not null.sql
- a verbatim sql condition. Either this parameter or
comparison must be not null.preparedStatementReplacements
- Values for the placeholders
in the verbatim sql condition.
NullPointerException
- if column is null.public Criterion(Object lValue, Object rValue)
lValue
- the left hand side value of the comparison, not null.
If this value should be a value from the database,
the object must implement the
org.apache.torque.Column
interface.rValue
- the right hand side value of the comparison.
If this value should be a value from the database,
the object must implement the
org.apache.torque.Column
interface.public Criterion(Object lValue, Object rValue, SqlEnum comparison)
lValue
- the left hand side value of the comparison, not null.
If this value should be a value from the database,
the object must implement the
org.apache.torque.Column
interface.rValue
- the right hand side value of the comparison.
If this value should be a value from the database,
the object must implement the
org.apache.torque.Column
interface.comparison
- The comparison operator, not null.public Criterion(Criterion toCopy)
toCopy
- the Criterion to copy from, not null.Method Detail |
---|
public Object getLValue()
org.apache.torque.Column
interface.public void setLValue(Object lValue)
lValue
- the left hand side value of the comparison.
If this value is a value computed by the database,
the object must implement the
org.apache.torque.Column
interface.public SqlEnum getComparison()
public Object getRValue()
org.apache.torque.Column
interface.public void setRValue(Object rValue)
rValue
- the right hand side value of the comparison.
If this value is a value computed by the database,
the object must implement the
org.apache.torque.Column
interface.public String getSql()
public Object[] getPreparedStatementReplacements()
public boolean isVerbatimSqlCondition()
public Criterion setIgnoreCase(boolean b)
b
- True if case should be ignored.
public boolean isIgnoreCase()
public List<Criterion> getParts()
public String getConjunction()
public boolean isComposite()
public Criterion and(Criterion criterion)
criterion
- the criterion to and with this criterion,
not null.public Criterion or(Criterion criterion)
criterion
- the criterion to and with this criterion,
not null.public void appendTo(StringBuilder sb)
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |