|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.torque.util.Criteria
@Deprecated public class Criteria
Encapsulates conditions to access rows in database tables.
Nested Class Summary | |
---|---|
class |
Criteria.Criterion
Deprecated. This is an inner class that describes an object in the criteria. |
Field Summary | |
---|---|
static SqlEnum |
ALL
Deprecated. Comparison type. |
static SqlEnum |
ALT_NOT_EQUAL
Deprecated. Comparison type. |
static SqlEnum |
CURRENT_DATE
Deprecated. "CURRENT_DATE" ANSI SQL function |
static SqlEnum |
CURRENT_TIME
Deprecated. "CURRENT_TIME" ANSI SQL function |
static SqlEnum |
CUSTOM
Deprecated. Comparison type. |
static SqlEnum |
DISTINCT
Deprecated. Comparison type. |
static SqlEnum |
EQUAL
Deprecated. Comparison type. |
static SqlEnum |
GREATER_EQUAL
Deprecated. Comparison type. |
static SqlEnum |
GREATER_THAN
Deprecated. Comparison type. |
static SqlEnum |
ILIKE
Deprecated. Comparison type. |
static SqlEnum |
IN
Deprecated. Comparison type. |
static JoinType |
INNER_JOIN
Deprecated. "INNER JOIN" SQL statement |
static SqlEnum |
ISNOTNULL
Deprecated. "IS NOT NULL" null comparison |
static SqlEnum |
ISNULL
Deprecated. "IS NULL" null comparison |
static SqlEnum |
JOIN
Deprecated. Comparison type. |
static JoinType |
LEFT_JOIN
Deprecated. "LEFT JOIN" SQL statement |
static SqlEnum |
LESS_EQUAL
Deprecated. Comparison type. |
static SqlEnum |
LESS_THAN
Deprecated. Comparison type. |
static SqlEnum |
LIKE
Deprecated. Comparison type. |
static SqlEnum |
NOT_EQUAL
Deprecated. Comparison type. |
static SqlEnum |
NOT_ILIKE
Deprecated. Comparison type. |
static SqlEnum |
NOT_IN
Deprecated. Comparison type. |
static SqlEnum |
NOT_LIKE
Deprecated. Comparison type. |
static JoinType |
RIGHT_JOIN
Deprecated. "RIGHT JOIN" SQL statement |
Constructor Summary | |
---|---|
Criteria()
Deprecated. Creates a new instance with the default capacity. |
|
Criteria(int initialCapacity)
Deprecated. initialCapacity is disregarded |
|
Criteria(String dbName)
Deprecated. Creates a new instance with the default capacity which corresponds to the specified database. |
|
Criteria(String dbName,
int initialCapacity)
Deprecated. initialCapacity is disregarded |
Method Summary | |
---|---|
Criteria |
add(Column column,
Object value)
Deprecated. This method adds a new criterion to the list of criterias. |
Criteria |
add(Column column,
Object value,
SqlEnum comparison)
Deprecated. This method adds a new criterion to the list of criterias. |
Criteria |
add(Criteria.Criterion c)
Deprecated. This method adds a prepared Criterion object to the Criteria. |
Criteria |
add(String column,
Object value)
Deprecated. This method adds a new criterion to the list of criterias. |
Criteria |
add(String column,
Object value,
SqlEnum comparison)
Deprecated. This method adds a new criterion to the list of criterias. |
Criteria |
add(String table,
String column,
Object value)
Deprecated. This method adds a new criterion to the list of criterias. |
Criteria |
add(String table,
String column,
Object value,
SqlEnum comparison)
Deprecated. This method adds a new criterion to the list of criterias. |
void |
addAlias(String alias,
String table)
Deprecated. Allows one to specify an alias for a table that can be used in various parts of the SQL. |
Criteria |
addAscendingOrderByColumn(Column column)
Deprecated. Add order by column name, explicitly specifying ascending. |
Criteria |
addAscendingOrderByColumn(Column column,
boolean ignoreCase)
Deprecated. Add order by column name, explicitly specifying ascending. |
Criteria |
addAscendingOrderByColumn(String column)
Deprecated. Add order by column name, explicitly specifying ascending. |
Criteria |
addAsColumn(String name,
Column clause)
Deprecated. Add an AS clause to the select columns. |
Criteria |
addAsColumn(String name,
String clause)
Deprecated. Add an AS clause to the select columns. |
Criteria |
addDate(Column column,
int year,
int month,
int day)
Deprecated. Convenience method to add a Date object specified by year, month, and date into the Criteria. |
Criteria |
addDate(Column column,
int year,
int month,
int date,
SqlEnum comparison)
Deprecated. Convenience method to add a Date object specified by year, month, and date into the Criteria. |
Criteria |
addDate(String column,
int year,
int month,
int day)
Deprecated. Convenience method to add a Date object specified by year, month, and date into the Criteria. |
Criteria |
addDate(String column,
int year,
int month,
int date,
SqlEnum comparison)
Deprecated. Convenience method to add a Date object specified by year, month, and date into the Criteria. |
Criteria |
addDescendingOrderByColumn(Column column)
Deprecated. Add order by column name, explicitly specifying descending. |
Criteria |
addDescendingOrderByColumn(Column column,
boolean ignoreCase)
Deprecated. Add order by column name, explicitly specifying descending. |
Criteria |
addDescendingOrderByColumn(String column)
Deprecated. Add order by column name, explicitly specifying descending. |
Criteria |
addGroupByColumn(Column groupBy)
Deprecated. Add group by column name. |
Criteria |
addGroupByColumn(String groupBy)
Deprecated. Add group by column name. |
Criteria |
addHaving(Criteria.Criterion having)
Deprecated. This method adds a prepared Criterion object to the Criteria as a having clause. |
Criteria |
addIn(Column column,
Collection<?> values)
Deprecated. Adds an 'IN' clause with the criteria supplied as a Collection. |
Criteria |
addIn(Column column,
Object[] values)
Deprecated. Adds an 'IN' clause with the criteria supplied as an Object array. |
Criteria |
addIn(String column,
Collection<?> values)
Deprecated. Adds an 'IN' clause with the criteria supplied as a Collection. |
Criteria |
addIn(String column,
Object[] values)
Deprecated. Adds an 'IN' clause with the criteria supplied as an Object array. |
Criteria |
addJoin(Column left,
Column right)
Deprecated. This is the way that you should add a join of two tables. |
Criteria |
addJoin(Column left,
Column right,
JoinType operator)
Deprecated. This is the way that you should add a join of two tables. |
Criteria |
addJoin(String left,
String right)
Deprecated. This is the way that you should add a join of two tables. |
Criteria |
addJoin(String left,
String right,
JoinType operator)
Deprecated. This is the way that you should add a join of two tables. |
Criteria |
addNotIn(Column column,
Collection<?> values)
Deprecated. Adds a 'NOT IN' clause with the criteria supplied as a Collection. |
Criteria |
addNotIn(Column column,
Object[] values)
Deprecated. Adds a 'NOT IN' clause with the criteria supplied as an Object array. |
Criteria |
addNotIn(String column,
Collection<?> values)
Deprecated. Adds a 'NOT IN' clause with the criteria supplied as a Collection. |
Criteria |
addNotIn(String column,
Object[] values)
Deprecated. Adds a 'NOT IN' clause with the criteria supplied as an Object array. |
Criteria |
addSelectColumn(Column column)
Deprecated. Add select column. |
Criteria |
addSelectColumn(String column)
Deprecated. Add select column. |
Criteria |
and(Column column,
Object value)
Deprecated. This method adds a new criterion to the list of criterias. |
Criteria |
and(Column column,
Object value,
SqlEnum comparison)
Deprecated. This method adds a new criterion to the list of criterias. |
Criteria |
and(Criteria.Criterion c)
Deprecated. This method adds a prepared Criterion object to the Criteria. |
Criteria |
and(String column,
Object value)
Deprecated. This method adds a new criterion to the list of criterias. |
Criteria |
and(String column,
Object value,
SqlEnum comparison)
Deprecated. This method adds a new criterion to the list of criterias. |
Criteria |
and(String table,
String column,
Object value)
Deprecated. use and(Column, Object) instead |
Criteria |
and(String table,
String column,
Object value,
SqlEnum comparison)
Deprecated. use and(Column, Object, comparison) instead |
Criteria |
andDate(Column column,
int year,
int month,
int date)
Deprecated. Convenience method to add a Date object specified by year, month, and date into the Criteria. |
Criteria |
andDate(Column column,
int year,
int month,
int date,
SqlEnum comparison)
Deprecated. Convenience method to add a Date object specified by year, month, and date into the Criteria. |
Criteria |
andDate(String column,
int year,
int month,
int date)
Deprecated. Convenience method to add a Date object specified by year, month, and date into the Criteria. |
Criteria |
andDate(String column,
int year,
int month,
int date,
SqlEnum comparison)
Deprecated. Convenience method to add a Date object specified by year, month, and date into the Criteria. |
Criteria |
andIn(Column column,
Collection<?> values)
Deprecated. Adds an 'IN' clause with the criteria supplied as a List. |
Criteria |
andIn(Column column,
Object[] values)
Deprecated. Adds an 'IN' clause with the criteria supplied as an Object array. |
Criteria |
andIn(String column,
Collection<?> values)
Deprecated. Adds an 'IN' clause with the criteria supplied as a List. |
Criteria |
andIn(String column,
Object[] values)
Deprecated. Adds an 'IN' clause with the criteria supplied as an Object array. |
Criteria |
andNotIn(Column column,
Collection<?> values)
Deprecated. Adds a 'NOT IN' clause with the criteria supplied as a List. |
Criteria |
andNotIn(Column column,
Object[] values)
Deprecated. Adds a 'NOT IN' clause with the criteria supplied as an Object array. |
Criteria |
andNotIn(String column,
Collection<?> values)
Deprecated. Adds a 'NOT IN' clause with the criteria supplied as a List. |
Criteria |
andNotIn(String column,
Object[] values)
Deprecated. Adds a 'NOT IN' clause with the criteria supplied as an Object array. |
void |
clear()
Deprecated. Brings this criteria back to its initial state, so that it can be reused as if it was new. |
boolean |
containsKey(String table,
String column)
Deprecated. this method does not check in all cases whether a matching criterion is contained (e.g. if the criterion has been added manually with another key). |
boolean |
equals(Object object)
Deprecated. Checks whether an object is equal to this Criteria. |
Object |
get(Column key)
Deprecated. this method only works if a criterion exists for the key. |
Map<String,String> |
getAliases()
Deprecated. Get the table aliases. |
Map<String,Column> |
getAsColumns()
Deprecated. Get the column aliases. |
BigDecimal |
getBigDecimal(Column column)
Deprecated. Convenience method to return a BigDecimal. |
BigDecimal |
getBigDecimal(String table,
String column)
Deprecated. Convenience method to return a BigDecimal. |
boolean |
getBoolean(Column column)
Deprecated. Convenience method to return value as a boolean. |
boolean |
getBoolean(String table,
String column)
Deprecated. Convenience method to return value as a boolean. |
SqlEnum |
getComparison(Column key)
Deprecated. Method to return a comparison String. |
SqlEnum |
getComparison(String table,
String column)
Deprecated. Method to return a comparison String. |
Criteria.Criterion |
getCriterion(Column column)
Deprecated. Return the criterion for a column. |
Criteria.Criterion |
getCriterion(String column)
Deprecated. Method to return criteria related to a column in a table. |
Criteria.Criterion |
getCriterion(String table,
String column)
Deprecated. Method to return criteria related to a column in a table. |
Date |
getDate(Column column)
Deprecated. Convenience method to return a Date. |
Date |
getDate(String table,
String column)
Deprecated. Convenience method to return a Date. |
String |
getDbName()
Deprecated. Get the Database(Map) name. |
double |
getDouble(Column column)
Deprecated. Convenience method to return a double. |
double |
getDouble(String table,
String column)
Deprecated. Convenience method to return a double. |
float |
getFloat(Column column)
Deprecated. Convenience method to return a float. |
float |
getFloat(String table,
String column)
Deprecated. Convenience method to return a float. |
UniqueColumnList |
getGroupByColumns()
Deprecated. Get group by columns. |
Criteria.Criterion |
getHaving()
Deprecated. Get Having Criterion. |
int |
getInt(Column column)
Deprecated. Convenience method to return an int. |
int |
getInt(String table,
String column)
Deprecated. Convenience method to return an int. |
Integer |
getInteger(Column column)
Deprecated. Convenience method to return an Integer. |
Integer |
getInteger(String table,
String column)
Deprecated. Convenience method to return an Integer. |
List<Join> |
getJoins()
Deprecated. get the List of Joins. |
int |
getLimit()
Deprecated. Get limit. |
List<Object> |
getList(Column column)
Deprecated. Convenience method to return a List. |
List<Object> |
getList(String table,
String column)
Deprecated. Convenience method to return a List. |
long |
getLong(Column column)
Deprecated. Convenience method to return a long. |
long |
getLong(String table,
String column)
Deprecated. Convenience method to return a long. |
Criteria.Criterion |
getNewCriterion(Column column,
Object value,
SqlEnum comparison)
Deprecated. Method to return criterion that is not added automatically to this Criteria. |
Criteria.Criterion |
getNewCriterion(String column,
Object value,
SqlEnum comparison)
Deprecated. Method to return criterion that is not added automatically to this Criteria. |
Criteria.Criterion |
getNewCriterion(String table,
String column,
Object value,
SqlEnum comparison)
Deprecated. Method to return criterion that is not added automatically to this Criteria. |
ObjectKey |
getObjectKey(Column column)
Deprecated. Convenience method to return an ObjectKey. |
ObjectKey |
getObjectKey(String table,
String column)
Deprecated. Convenience method to return an ObjectKey. |
long |
getOffset()
Deprecated. Get offset. |
UniqueList<OrderBy> |
getOrderByColumns()
Deprecated. Get order by columns. |
UniqueColumnList |
getSelectColumns()
Deprecated. Get select columns. |
UniqueList<String> |
getSelectModifiers()
Deprecated. Get select modifiers. |
String |
getString(Column column)
Deprecated. Convenience method to return a String. |
String |
getString(String table,
String column)
Deprecated. Convenience method to return a String. |
String |
getTableForAlias(String alias)
Deprecated. Returns the table name associated with an alias. |
Object |
getValue(Column column)
Deprecated. Method to return the value that was added to Criteria. |
Object |
getValue(String table,
String column)
Deprecated. Method to return the value that was added to Criteria. |
int |
hashCode()
Deprecated. Returns the hash code value for this Join. |
boolean |
isEmpty()
Deprecated. Returns whether there are any criterions in this criteria. |
boolean |
isIgnoreCase()
Deprecated. Returns whether case should be ignored in where clauses and order by whenever String columns are encountered. |
boolean |
isSingleRecord()
Deprecated. Is single record? |
Set<Column> |
keySet()
Deprecated. Returns all keys in the Criterion map. |
Criteria |
or(Column column,
Object value)
Deprecated. This method adds a new criterion to the list of criterias. |
Criteria |
or(Column column,
Object value,
SqlEnum comparison)
Deprecated. This method adds a new criterion to the list of criterias. |
Criteria |
or(Criteria.Criterion c)
Deprecated. This method adds a prepared Criterion object to the Criteria. |
Criteria |
or(String column,
Object value)
Deprecated. This method adds a new criterion to the list of criterias. |
Criteria |
or(String column,
Object value,
SqlEnum comparison)
Deprecated. This method adds a new criterion to the list of criterias. |
Criteria |
or(String table,
String column,
Object value)
Deprecated. use or(Column, Object) instead |
Criteria |
or(String table,
String column,
Object value,
SqlEnum comparison)
Deprecated. use or(Column, Object, SqlEnum) instead |
Criteria |
orDate(Column column,
int year,
int month,
int date)
Deprecated. Convenience method to add a Date object specified by year, month, and date into the Criteria. |
Criteria |
orDate(Column column,
int year,
int month,
int date,
SqlEnum comparison)
Deprecated. Convenience method to add a Date object specified by year, month, and date into the Criteria. |
Criteria |
orDate(String column,
int year,
int month,
int date)
Deprecated. Convenience method to add a Date object specified by year, month, and date into the Criteria. |
Criteria |
orDate(String column,
int year,
int month,
int date,
SqlEnum comparison)
Deprecated. Convenience method to add a Date object specified by year, month, and date into the Criteria. |
Criteria |
orIn(Column column,
Collection<?> values)
Deprecated. Adds an 'IN' clause with the criteria supplied as a List. |
Criteria |
orIn(Column column,
Object[] values)
Deprecated. Adds an 'IN' clause with the criteria supplied as an Object array. |
Criteria |
orIn(String column,
Collection<?> values)
Deprecated. Adds an 'IN' clause with the criteria supplied as a List. |
Criteria |
orIn(String column,
Object[] values)
Deprecated. Adds an 'IN' clause with the criteria supplied as an Object array. |
Criteria |
orNotIn(Column column,
Collection<?> values)
Deprecated. Adds a 'NOT IN' clause with the criteria supplied as a List. |
Criteria |
orNotIn(Column column,
Object[] values)
Deprecated. Adds a 'NOT IN' clause with the criteria supplied as an Object array. |
Criteria |
orNotIn(String column,
Collection<?> values)
Deprecated. Adds a 'NOT IN' clause with the criteria supplied as a List. |
Criteria |
orNotIn(String column,
Object[] values)
Deprecated. Adds a 'NOT IN' clause with the criteria supplied as an Object array. |
Object |
put(Column column,
Object value)
Deprecated. use add(String, Object) instead |
void |
putAll(Map<Column,Criteria.Criterion> t)
Deprecated. Copies all of the mappings from the specified Map to this Criteria These mappings will replace any mappings that this Criteria had for any of the keys currently in the specified Map. |
Object |
remove(Column key)
Deprecated. Remove all objects with the given key from the criteria. |
void |
setAll()
Deprecated. Adds "ALL " to the SQL statement. |
void |
setDbName(String dbName)
Deprecated. Set the DatabaseMap name. |
void |
setDistinct()
Deprecated. Adds "DISTINCT " to the SQL statement. |
Criteria |
setIgnoreCase(boolean b)
Deprecated. Sets whether case should be ignored in where clauses and order by whenever String columns are encountered. |
Criteria |
setLimit(int limit)
Deprecated. Set limit. |
Criteria |
setOffset(long offset)
Deprecated. Set offset. |
Criteria |
setSingleRecord(boolean b)
Deprecated. Set single record? Set this to true if you expect the query
to result in only a single result record (the default behaviour is to
throw a TorqueException if multiple records are returned when the query
is executed). |
int |
size()
Deprecated. this method counts only top-level criterions, not all. |
String |
toString()
Deprecated. Build a string representation of the Criteria. |
Collection<Criteria.Criterion> |
values()
Deprecated. Returns all the top-level Criterions in this criteria (but not the chained Criterions). |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final SqlEnum EQUAL
public static final SqlEnum NOT_EQUAL
public static final SqlEnum ALT_NOT_EQUAL
public static final SqlEnum GREATER_THAN
public static final SqlEnum LESS_THAN
public static final SqlEnum GREATER_EQUAL
public static final SqlEnum LESS_EQUAL
public static final SqlEnum LIKE
public static final SqlEnum NOT_LIKE
public static final SqlEnum ILIKE
public static final SqlEnum NOT_ILIKE
public static final SqlEnum CUSTOM
public static final SqlEnum DISTINCT
public static final SqlEnum IN
public static final SqlEnum NOT_IN
public static final SqlEnum ALL
public static final SqlEnum JOIN
public static final SqlEnum ISNULL
public static final SqlEnum ISNOTNULL
public static final SqlEnum CURRENT_DATE
public static final SqlEnum CURRENT_TIME
public static final JoinType LEFT_JOIN
public static final JoinType RIGHT_JOIN
public static final JoinType INNER_JOIN
Constructor Detail |
---|
public Criteria()
@Deprecated public Criteria(int initialCapacity)
initialCapacity
- An int.public Criteria(String dbName)
dbName
- The dabase name.@Deprecated public Criteria(String dbName, int initialCapacity)
dbName
- The dabase name.initialCapacity
- The initial capacity.Method Detail |
---|
public void clear()
public Criteria addAsColumn(String name, Column clause)
Criteria myCrit = new Criteria();
myCrit.addAsColumn("alias", "ALIAS("+MyPeer.ID+")");
name
- wanted Name of the columnclause
- SQL clause to select from the table
If the name already exists, it is replaced by the new clause.
public Criteria addAsColumn(String name, String clause)
Criteria myCrit = new Criteria();
myCrit.addAsColumn("alias", "ALIAS("+MyPeer.ID+")");
name
- wanted Name of the columnclause
- SQL clause to select from the table
If the name already exists, it is replaced by the new clause.
public Map<String,Column> getAsColumns()
getAsColumns
in interface CriteriaInterface<Criteria>
public Map<String,String> getAliases()
getAliases
in interface CriteriaInterface<Criteria>
public void addAlias(String alias, String table)
addAlias
in interface CriteriaInterface<Criteria>
alias
- a String
valuetable
- a String
valuepublic String getTableForAlias(String alias)
getTableForAlias
in interface CriteriaInterface<Criteria>
alias
- a String
value
String
value@Deprecated public boolean containsKey(String table, String column)
table
- The name of the table.column
- The name of the column.
public Criteria.Criterion getCriterion(Column column)
column
- the column to get the criterion for.
public Criteria.Criterion getCriterion(String column)
column
- the column to get the criterion for.
public Criteria.Criterion getCriterion(String table, String column)
table
- String name of table.column
- String name of column.
public Criteria.Criterion getNewCriterion(Column column, Object value, SqlEnum comparison)
column
- String full name of column (for example TABLE.COLUMN).value
- The value to compare to.comparison
- the comparison to use.
public Criteria.Criterion getNewCriterion(String column, Object value, SqlEnum comparison)
column
- String full name of column (for example TABLE.COLUMN).value
- The value to compare to.comparison
- the comparison to use.
public Criteria.Criterion getNewCriterion(String table, String column, Object value, SqlEnum comparison)
table
- String name of table.column
- String name of column.
public Criteria add(Criteria.Criterion c)
Criteria crit = new Criteria();
Criteria.Criterion c = crit
.getNewCriterion(XXXPeer.ID, new Integer(5), Criteria.LESS_THAN);
crit.add(c);
c
- A Criterion object
public SqlEnum getComparison(Column key)
key
- String name of the key.
public SqlEnum getComparison(String table, String column)
table
- String name of table.column
- String name of column.
public String getDbName()
getDbName
in interface CriteriaInterface<Criteria>
public void setDbName(String dbName)
null
is supplied, uses value
provided by Torque.getDefaultDB()
.
setDbName
in interface CriteriaInterface<Criteria>
dbName
- A String with the Database(Map) name.public boolean getBoolean(Column column)
column
- The column to retrieve the value for.
public boolean getBoolean(String table, String column)
table
- String name of table.column
- String name of column.
public Date getDate(Column column)
column
- The column to retrieve the value for.
public Date getDate(String table, String column)
table
- String name of table.column
- String name of column.
public double getDouble(Column column)
column
- The column to retrieve the value for.
public double getDouble(String table, String column)
table
- String name of table.column
- String name of column.
public float getFloat(Column column)
column
- The column to retrieve the value for.
public float getFloat(String table, String column)
table
- String name of table.column
- String name of column.
public Integer getInteger(Column column)
column
- The column to retrieve the value for.
public Integer getInteger(String table, String column)
table
- String name of table.column
- String name of column.
public int getInt(Column column)
column
- The column to retrieve the value for.
public int getInt(String table, String column)
table
- String name of table.column
- String name of column.
public BigDecimal getBigDecimal(Column column)
column
- The column to retrieve the value for.
public BigDecimal getBigDecimal(String table, String column)
table
- String name of table.column
- String name of column.
public long getLong(Column column)
column
- The column to retrieve the value for.
public long getLong(String table, String column)
table
- String name of table.column
- String name of column.
public String getString(Column column)
column
- The column to retrieve the value for.
public String getString(String table, String column)
table
- String name of table.column
- String name of column.
public List<Object> getList(Column column)
column
- The column to retrieve the value for.
public List<Object> getList(String table, String column)
table
- String name of table.column
- String name of column.
public Object getValue(Column column)
column
- The column to retrieve the value for.
public Object getValue(String table, String column)
table
- String name of table.column
- String name of column.
public ObjectKey getObjectKey(Column column)
column
- The column to retrieve the value for.
public ObjectKey getObjectKey(String table, String column)
table
- String name of table.column
- String name of column.
@Deprecated public Object get(Column key)
key
- the key for the criterion.
NullPointerException
- if no Criterion is stored under the key.public boolean isEmpty()
@Deprecated public int size()
public Collection<Criteria.Criterion> values()
@Deprecated public Object put(Column column, Object value)
column
- the column.value
- An Object to which the column should be equal.
NullPointerException
- if key is null.public void putAll(Map<Column,Criteria.Criterion> t)
t
- Objects to be stored in this criteria.public Criteria add(Column column, Object value)
Criteria crit = new Criteria().add("column",
"value");
An EQUAL comparison is used for column and value.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the add(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.
public Criteria add(Column column, Object value, SqlEnum comparison)
Criteria crit = new Criteria().add("column",
"value"
Criteria.GREATER_THAN);
Any comparison can be used.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the add(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.comparison
- A String.
public Criteria add(String column, Object value)
Criteria crit = new Criteria().add("column",
"value");
An EQUAL comparison is used for column and value.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the add(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.
public Criteria add(String column, Object value, SqlEnum comparison)
Criteria crit = new Criteria().add("column",
"value"
Criteria.GREATER_THAN);
Any comparison can be used.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the add(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.comparison
- A String.
public Criteria add(String table, String column, Object value)
Criteria crit = new Criteria().add("table",
"column",
"value");
An EQUAL comparison is used for column and value.
table
- Name of the table which contains the columncolumn
- The column to run the comparison onvalue
- An Object.
public Criteria add(String table, String column, Object value, SqlEnum comparison)
Criteria crit = new Criteria().add("table",
"column",
"value",
Criteria.GREATER_THAN);
Any comparison can be used.
table
- Name of table which contains the columncolumn
- The column to run the comparison onvalue
- An Object.comparison
- String describing how to compare the column with
the value
public Criteria addDate(Column column, int year, int month, int day)
add(column, new GregorianCalendar(year, month,date), EQUAL);
column
- A String value to use as column.year
- An int with the year.month
- An int with the month. Month value is 0-based.
e.g., 0 for Januaryday
- An int with the day.
public Criteria addDate(Column column, int year, int month, int date, SqlEnum comparison)
add(column, new GregorianCalendar(year, month,date), comparison);
column
- The column to run the comparison onyear
- An int with the year.month
- An int with the month. Month value is 0-based.
e.g., 0 for Januarydate
- An int with the date.comparison
- String describing how to compare the column with
the value
public Criteria addDate(String column, int year, int month, int day)
add(column, new GregorianCalendar(year, month,date), EQUAL);
column
- A String value to use as column.year
- An int with the year.month
- An int with the month. Month value is 0-based.
e.g., 0 for Januaryday
- An int with the day.
public Criteria addDate(String column, int year, int month, int date, SqlEnum comparison)
add(column, new GregorianCalendar(year, month,date), comparison);
column
- The column to run the comparison onyear
- An int with the year.month
- An int with the month. Month value is 0-based.
e.g., 0 for Januarydate
- An int with the date.comparison
- String describing how to compare the column with
the value
public Criteria addJoin(Column left, Column right)
AND PROJECT.PROJECT_ID=FOO.PROJECT_ID
left = PROJECT.PROJECT_ID right = FOO.PROJECT_ID
left
- A String with the left side of the join.right
- A String with the right side of the join.
public Criteria addJoin(Column left, Column right, JoinType operator)
PROJECT LEFT JOIN FOO ON PROJECT.PROJECT_ID=FOO.PROJECT_ID
left = "PROJECT.PROJECT_ID" right = "FOO.PROJECT_ID" operator = Criteria.LEFT_JOIN
left
- A String with the left side of the join.right
- A String with the right side of the join.operator
- The operator used for the join: must be one of null,
Criteria.LEFT_JOIN, Criteria.RIGHT_JOIN, Criteria.INNER_JOIN
public Criteria addJoin(String left, String right)
AND PROJECT.PROJECT_ID=FOO.PROJECT_ID
left = PROJECT.PROJECT_ID right = FOO.PROJECT_ID
left
- A String with the left side of the join.right
- A String with the right side of the join.
public Criteria addJoin(String left, String right, JoinType operator)
PROJECT LEFT JOIN FOO ON PROJECT.PROJECT_ID=FOO.PROJECT_ID
left = "PROJECT.PROJECT_ID" right = "FOO.PROJECT_ID" operator = Criteria.LEFT_JOIN
left
- A String with the left side of the join.right
- A String with the right side of the join.operator
- The operator used for the join: must be one of null,
Criteria.LEFT_JOIN, Criteria.RIGHT_JOIN, Criteria.INNER_JOIN
public List<Join> getJoins()
getJoins
in interface CriteriaInterface<Criteria>
public Criteria addIn(Column column, Object[] values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is replaced.
column
- The column to run the comparison onvalues
- An Object[] with the allowed values.
public Criteria addIn(String column, Object[] values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is replaced.
column
- The column to run the comparison onvalues
- An Object[] with the allowed values.
public Criteria addIn(Column column, Collection<?> values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three Strings "FOO", "BAR" and "ZOW". If a criterion for the requested column already exists, it is replaced.
column
- The column to run the comparison onvalues
- A Collection with the allowed values.
public Criteria addIn(String column, Collection<?> values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three Strings "FOO", "BAR" and "ZOW". If a criterion for the requested column already exists, it is replaced.
column
- The column to run the comparison onvalues
- A Collection with the allowed values.
public Criteria addNotIn(Column column, Object[] values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is replaced.
column
- The column to run the comparison onvalues
- An Object[] with the disallowed values.
public Criteria addNotIn(String column, Object[] values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is replaced.
column
- The column to run the comparison onvalues
- An Object[] with the disallowed values.
public Criteria addNotIn(Column column, Collection<?> values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three Strings "FOO", "BAR" and "ZOW". If a criterion for the requested column already exists, it is replaced.
column
- The column to run the comparison onvalues
- A Collection with the disallowed values.
public Criteria addNotIn(String column, Collection<?> values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three Strings "FOO", "BAR" and "ZOW". If a criterion for the requested column already exists, it is replaced.
column
- The column to run the comparison onvalues
- A Collection with the disallowed values.
public void setAll()
setAll
in interface CriteriaInterface<Criteria>
public void setDistinct()
setDistinct
in interface CriteriaInterface<Criteria>
public Criteria setIgnoreCase(boolean b)
b
- True if case should be ignored.
public boolean isIgnoreCase()
isIgnoreCase
in interface CriteriaInterface<Criteria>
public Criteria setSingleRecord(boolean b)
true
if you expect the query
to result in only a single result record (the default behaviour is to
throw a TorqueException if multiple records are returned when the query
is executed). This should be used in situations where returning multiple
rows would indicate an error of some sort. If your query might return
multiple records but you are only interested in the first one then you
should be using setLimit(1).
b
- set to true
if you expect the query to select just
one record.
public boolean isSingleRecord()
isSingleRecord
in interface CriteriaInterface<Criteria>
public Criteria setLimit(int limit)
setLimit
in interface CriteriaInterface<Criteria>
limit
- An int with the value for limit.
public int getLimit()
getLimit
in interface CriteriaInterface<Criteria>
public Criteria setOffset(long offset)
setOffset
in interface CriteriaInterface<Criteria>
offset
- An int with the value for offset.
public long getOffset()
getOffset
in interface CriteriaInterface<Criteria>
public Criteria addSelectColumn(Column column)
column
- The select column to add.
public Criteria addSelectColumn(String column)
column
- A String with the name of the select column.
public UniqueColumnList getSelectColumns()
getSelectColumns
in interface CriteriaInterface<Criteria>
public UniqueList<String> getSelectModifiers()
getSelectModifiers
in interface CriteriaInterface<Criteria>
public Criteria addGroupByColumn(Column groupBy)
groupBy
- The name of the column to group by.
public Criteria addGroupByColumn(String groupBy)
groupBy
- The name of the column to group by.
public Criteria addAscendingOrderByColumn(Column column)
column
- The column to order by.
public Criteria addAscendingOrderByColumn(Column column, boolean ignoreCase)
column
- The column to order by.ignoreCase
- whether to ignore case on String columns.
public Criteria addAscendingOrderByColumn(String column)
column
- The column to order by.
public Criteria addDescendingOrderByColumn(Column column)
column
- The column to order by.
public Criteria addDescendingOrderByColumn(Column column, boolean ignoreCase)
column
- The column to order by.ignoreCase
- whether to ignore case on String columns.
public Criteria addDescendingOrderByColumn(String column)
column
- The column to order by.
public UniqueList<OrderBy> getOrderByColumns()
getOrderByColumns
in interface CriteriaInterface<Criteria>
public UniqueColumnList getGroupByColumns()
getGroupByColumns
in interface CriteriaInterface<Criteria>
public Criteria.Criterion getHaving()
public Object remove(Column key)
key
- A String with the key to be removed.
public String toString()
toString
in class Object
public Set<Column> keySet()
public boolean equals(Object object)
equals
in class Object
object
- the other object to check, can be null.
public int hashCode()
hashCode
in class Object
public Criteria addHaving(Criteria.Criterion having)
Criteria crit = new Criteria();
Criteria.Criterion c = crit.getNewCriterion(XXXPeer.ID, new Integer(5),
Criteria.LESS_THAN);
crit.addHaving(c);
having
- A Criterion object
public Criteria and(Criteria.Criterion c)
Criteria crit = new Criteria();
Criteria.Criterion c = crit.getNewCriterion(XXXPeer.ID, new Integer(5),
Criteria.LESS_THAN);
crit.and(c);
c
- A Criterion object
public Criteria and(Column column, Object value)
Criteria crit = new Criteria().and("column",
"value");
An EQUAL comparison is used for column and value.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the and(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.
public Criteria and(Column column, Object value, SqlEnum comparison)
Criteria crit = new Criteria().and("column",
"value"
Criteria.GREATER_THAN);
Any comparison can be used.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the and(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.comparison
- A String.
public Criteria and(String column, Object value)
Criteria crit = new Criteria().and("column",
"value");
An EQUAL comparison is used for column and value.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the and(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.
public Criteria and(String column, Object value, SqlEnum comparison)
Criteria crit = new Criteria().and("column",
"value"
Criteria.GREATER_THAN);
Any comparison can be used.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the and(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.comparison
- A String.
@Deprecated public Criteria and(String table, String column, Object value)
Criteria crit = new Criteria().and("table",
"column",
"value");
An EQUAL comparison is used for column and value.
table
- Name of the table which contains the columncolumn
- The column to run the comparison onvalue
- An Object.
@Deprecated public Criteria and(String table, String column, Object value, SqlEnum comparison)
Criteria crit = new Criteria().and("table",
"column",
"value",
"Criterion.GREATER_THAN");
Any comparison can be used.
table
- Name of table which contains the columncolumn
- The column to run the comparison onvalue
- An Object.comparison
- String describing how to compare the column with
the value
public Criteria andDate(Column column, int year, int month, int date)
and(column, new GregorianCalendar(year, month,date), EQUAL);
column
- A String value to use as column.year
- An int with the year.month
- An int with the month.date
- An int with the date.
public Criteria andDate(Column column, int year, int month, int date, SqlEnum comparison)
and(column, new GregorianCalendar(year, month,date), comparison);
column
- The column to run the comparison onyear
- An int with the year.month
- An int with the month.date
- An int with the date.comparison
- String describing how to compare the column with
the value
public Criteria andDate(String column, int year, int month, int date)
and(column, new GregorianCalendar(year, month,date), EQUAL);
column
- A String value to use as column.year
- An int with the year.month
- An int with the month.date
- An int with the date.
public Criteria andDate(String column, int year, int month, int date, SqlEnum comparison)
and(column, new GregorianCalendar(year, month,date), comparison);
column
- The column to run the comparison onyear
- An int with the year.month
- An int with the month.date
- An int with the date.comparison
- String describing how to compare the column with
the value
public Criteria andIn(Column column, Object[] values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
column
- The column to run the comparison onvalues
- An Object[] with the allowed values.
public Criteria andIn(String column, Object[] values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
column
- The column to run the comparison onvalues
- An Object[] with the allowed values.
public Criteria andIn(Column column, Collection<?> values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
column
- The column to run the comparison onvalues
- A List with the allowed values.
public Criteria andIn(String column, Collection<?> values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
column
- The column to run the comparison onvalues
- A List with the allowed values.
public Criteria andNotIn(Column column, Object[] values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
column
- The column to run the comparison onvalues
- An Object[] with the disallowed values.
public Criteria andNotIn(String column, Object[] values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
column
- The column to run the comparison onvalues
- An Object[] with the disallowed values.
public Criteria andNotIn(Column column, Collection<?> values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
column
- The column to run the comparison onvalues
- A List with the disallowed values.
public Criteria andNotIn(String column, Collection<?> values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
column
- The column to run the comparison onvalues
- A List with the disallowed values.
public Criteria or(Criteria.Criterion c)
Criteria crit = new Criteria();
Criteria.Criterion c = crit.getNewCriterion(XXXPeer.ID, new Integer(5), Criteria.LESS_THAN);
crit.or(c);
c
- A Criterion object
public Criteria or(Column column, Object value)
Criteria crit = new Criteria().or("column",
"value");
An EQUAL comparison is used for column and value.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the or(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.
public Criteria or(String column, Object value)
Criteria crit = new Criteria().or("column",
"value");
An EQUAL comparison is used for column and value.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the or(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.
public Criteria or(Column column, Object value, SqlEnum comparison)
Criteria crit = new Criteria().or("column",
"value"
"Criterion.GREATER_THAN");
Any comparison can be used.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the or(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.comparison
- A String.
public Criteria or(String column, Object value, SqlEnum comparison)
Criteria crit = new Criteria().or("column",
"value"
"Criterion.GREATER_THAN");
Any comparison can be used.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the or(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.comparison
- A String.
@Deprecated public Criteria or(String table, String column, Object value)
Criteria crit = new Criteria().or("table",
"column",
"value");
An EQUAL comparison is used for column and value.
table
- Name of the table which contains the columncolumn
- The column to run the comparison onvalue
- An Object.
@Deprecated public Criteria or(String table, String column, Object value, SqlEnum comparison)
Criteria crit = new Criteria().or("table",
"column",
"value",
"Criterion.GREATER_THAN");
Any comparison can be used.
table
- Name of table which contains the columncolumn
- The column to run the comparison onvalue
- An Object.comparison
- String describing how to compare the column with the value
public Criteria orDate(Column column, int year, int month, int date)
or(column, new GregorianCalendar(year, month,date), EQUAL);
column
- A String value to use as column.year
- An int with the year.month
- An int with the month.date
- An int with the date.
public Criteria orDate(String column, int year, int month, int date)
or(column, new GregorianCalendar(year, month,date), EQUAL);
column
- A String value to use as column.year
- An int with the year.month
- An int with the month.date
- An int with the date.
public Criteria orDate(Column column, int year, int month, int date, SqlEnum comparison)
or(column, new GregorianCalendar(year, month,date), comparison);
column
- The column to run the comparison onyear
- An int with the year.month
- An int with the month.date
- An int with the date.comparison
- String describing how to compare the column
with the value
public Criteria orDate(String column, int year, int month, int date, SqlEnum comparison)
or(column, new GregorianCalendar(year, month,date), comparison);
column
- The column to run the comparison onyear
- An int with the year.month
- An int with the month.date
- An int with the date.comparison
- String describing how to compare the column
with the value
public Criteria orIn(Column column, Object[] values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
column
- The column to run the comparison onvalues
- An Object[] with the allowed values.
public Criteria orIn(String column, Object[] values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
column
- The column to run the comparison onvalues
- An Object[] with the allowed values.
public Criteria orIn(Column column, Collection<?> values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
column
- The column to run the comparison onvalues
- A List with the allowed values.
public Criteria orIn(String column, Collection<?> values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
column
- The column to run the comparison onvalues
- A List with the allowed values.
public Criteria orNotIn(Column column, Object[] values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
column
- The column to run the comparison onvalues
- An Object[] with the disallowed values.
public Criteria orNotIn(String column, Object[] values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
column
- The column to run the comparison onvalues
- An Object[] with the disallowed values.
public Criteria orNotIn(Column column, Collection<?> values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
column
- The column to run the comparison onvalues
- A List with the disallowed values.
public Criteria orNotIn(String column, Collection<?> values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
column
- The column to run the comparison onvalues
- A List with the disallowed values.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |