Package org.apache.torque.criteria
Klasse Criterion
java.lang.Object
org.apache.torque.criteria.Criterion
- Alle implementierten Schnittstellen:
Serializable
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.
- Siehe auch:
-
Feldübersicht
Felder -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCreate a new instance without verbatim sql, using equals as comparison operator.Create a new instance without verbatim sql.Criterion
(Object lValue, Object rValue, SqlEnum comparison, String sql, Object[] preparedStatementReplacements) Create a new instance.Create a new instance without verbatim sql, using a comparison operator without the need for a right value (likeSqlEnum.ISNULL
,SqlEnum.ISNOTNULL
, etc.)Creates a shallow copy of the given Criterion. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungReplaces this criterion's condition with (this criterion's condition AND criterion).void
Appends a debug String representation of the Criterion onto the String builder.boolean
Get the comparison.Returns the conjunction for the parts of this criterionGet the left hand side value of the comparison.getParts()
Returns the parts of which this criterion consists.Object[]
Returns the prepared statement replacements for a verbatim sql condition.Get the right hand side value of the comparison.getSql()
Returns the verbatim sql for this condition.int
hashCode()
boolean
Returns whether this criterion is a composite criterion.boolean
Is ignore case on or off?boolean
Returns whether this Criterion represents a verbatim sql condition.Replaces this criterion's condition with (this criterion's condition OR criterion).setIgnoreCase
(boolean b) Sets ignore case. ignoreCase is ignored for a verbatim sql statement.void
Set the left hand side value of the comparison.void
Set the right hand side value of the comparison.toString()
Build a string representation of the Criterion for debug purposes.
-
Felddetails
-
AND
Constant for the operator " AND ".- Siehe auch:
-
OR
Constant for the operator " OR ".- Siehe auch:
-
-
Konstruktordetails
-
Criterion
public Criterion(Object lValue, Object rValue, SqlEnum comparison, String sql, Object[] preparedStatementReplacements) Create a new instance. Either this Criterion represents a comparison without verbatim SQL; in this case the parameters lValue and comparison must be not null, rValue may be not null and sql and preparedStatementReplacements must be null; or it represents a verbatim sql condition, in which case the parameter comparison must be null and the sql must be not null (preparedStatementReplacements may be set to contain sql placeholder replacement values, and lValue and rValue can be set to add columns to the automatically computed from clause of the query).- Parameter:
lValue
- the left hand side value of the comparison. If this value should be a value from the database, the object must implement theorg.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 theorg.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.- Löst aus:
NullPointerException
- if column is null.
-
Criterion
Create a new instance without verbatim sql, using equals as comparison operator.- Parameter:
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 theorg.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 theorg.apache.torque.Column
interface.
-
Criterion
Create a new instance without verbatim sql, using a comparison operator without the need for a right value (likeSqlEnum.ISNULL
,SqlEnum.ISNOTNULL
, etc.)- Parameter:
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 theorg.apache.torque.Column
interface.comparison
- the comparison operator, not null. If the comparison operator needs 2 values, the second value will always be null.
-
Criterion
Create a new instance without verbatim sql.- Parameter:
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 theorg.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 theorg.apache.torque.Column
interface.comparison
- the comparison operator, not null.
-
Criterion
Creates a shallow copy of the given Criterion.- Parameter:
toCopy
- the Criterion to copy from, not null.
-
-
Methodendetails
-
getLValue
Get the left hand side value of the comparison.- Gibt zurück:
- the left hand side value of the comparison.
If this value is a value computed by the database,
the object implements the
org.apache.torque.Column
interface.
-
setLValue
Set the left hand side value of the comparison.- Parameter:
lValue
- the left hand side value of the comparison. If this value is a value computed by the database, the object must implement theorg.apache.torque.Column
interface.
-
getComparison
Get the comparison.- Gibt zurück:
- A String with the comparison, or null if this Criterion represents a verbatim sql condition.
-
getRValue
Get the right hand side value of the comparison.- Gibt zurück:
- the right hand side value of the comparison.
If this value is a value computed by the database,
the object implements the
org.apache.torque.Column
interface.
-
setRValue
Set the right hand side value of the comparison.- Parameter:
rValue
- the right hand side value of the comparison. If this value is a value computed by the database, the object must implement theorg.apache.torque.Column
interface.
-
getSql
Returns the verbatim sql for this condition.- Gibt zurück:
- the verbatim sql for this condition, or null if this Criterion does not represent a verbatim sql condition.
-
getPreparedStatementReplacements
Returns the prepared statement replacements for a verbatim sql condition.- Gibt zurück:
- the replacement values, or null.
-
isVerbatimSqlCondition
public boolean isVerbatimSqlCondition()Returns whether this Criterion represents a verbatim sql condition.- Gibt zurück:
- true if this Criterion represents a verbatim sql condition, false if the sql is computed from lValue, comparison and rValue.
-
setIgnoreCase
Sets ignore case. ignoreCase is ignored for a verbatim sql statement.- Parameter:
b
- True if case should be ignored.- Gibt zurück:
- A modified Criterion object.
-
isIgnoreCase
public boolean isIgnoreCase()Is ignore case on or off?- Gibt zurück:
- True if case is ignored.
-
getParts
Returns the parts of which this criterion consists.- Gibt zurück:
- an unmodifiable list of the clauses, or null if this criterion is not a composite criterion.
-
getConjunction
Returns the conjunction for the parts of this criterion- Gibt zurück:
- the conjunction, or null if this criterion is not a composite criterion.
-
isComposite
public boolean isComposite()Returns whether this criterion is a composite criterion.- Gibt zurück:
- true if this criterion is a composite criterion, false if it represents a single condition.
-
and
Replaces this criterion's condition with (this criterion's condition AND criterion).- Parameter:
criterion
- the criterion to and with this criterion, not null.- Gibt zurück:
- the modified Criteria object.
-
or
Replaces this criterion's condition with (this criterion's condition OR criterion).- Parameter:
criterion
- the criterion to and with this criterion, not null.- Gibt zurück:
- the modified Criteria object.
-
appendTo
Appends a debug String representation of the Criterion onto the String builder.- Parameter:
sb
- the string representation
-
toString
Build a string representation of the Criterion for debug purposes. -
equals
-
hashCode
public int hashCode()
-