| java.util.Hashtable org.apache.torque.util.Criteria
Inner Class :final public class Criterion implements Serializable | |
Inner Class :public static class Join | |
Constructor Summary | |
public | Criteria() Creates a new instance with the default capacity. | public | Criteria(int initialCapacity) Creates a new instance with the specified capacity. | public | Criteria(String dbName) Creates a new instance with the default capacity which corresponds to
the specified database. | public | Criteria(String dbName, int initialCapacity) Creates a new instance with the specified capacity which corresponds to
the specified database. |
Method Summary | |
public Criteria | add(Criterion c) This method adds a prepared Criterion object to the Criteria.
You can get a new, empty Criterion object with the
getNewCriterion() method. | public Criteria | add(String column, Object value) This method adds a new criterion to the list of criterias. | public Criteria | add(String column, Object value, SqlEnum comparison) This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
replaced. | public Criteria | add(String table, String column, Object value) This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
replaced. | public Criteria | add(String table, String column, Object value, SqlEnum comparison) This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
replaced. | public Criteria | add(String column, boolean value) Convenience method to add a boolean to Criteria.
Equal to
add(column, new Boolean(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A Boolean. | public Criteria | add(String column, boolean value, SqlEnum comparison) Convenience method to add a boolean to Criteria. | public Criteria | add(String column, int value) Convenience method to add an int to Criteria.
Equal to
add(column, new Integer(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - An int. | public Criteria | add(String column, int value, SqlEnum comparison) Convenience method to add an int to Criteria. | public Criteria | add(String column, long value) Convenience method to add a long to Criteria.
Equal to
add(column, new Long(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A long. | public Criteria | add(String column, long value, SqlEnum comparison) Convenience method to add a long to Criteria. | public Criteria | add(String column, float value) Convenience method to add a float to Criteria.
Equal to
add(column, new Float(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A float. | public Criteria | add(String column, float value, SqlEnum comparison) Convenience method to add a float to Criteria. | public Criteria | add(String column, double value) Convenience method to add a double to Criteria.
Equal to
add(column, new Double(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A double. | public Criteria | add(String column, double value, SqlEnum comparison) Convenience method to add a double to Criteria. | public void | addAlias(String alias, String table) Allows one to specify an alias for a table that can
be used in various parts of the SQL. | public Criteria | addAsColumn(String name, String clause) Add an AS clause to the select columns. | public Criteria | addAscendingOrderByColumn(String name) Add order by column name, explicitly specifying ascending.
Parameters: name - The name of the column to order by. | public Criteria | addDate(String column, int year, int month, int date) Convenience method to add a Date object specified by
year, month, and date into the Criteria.
Equal to
add(column, new GregorianCalendar(year, month,date), EQUAL);
Parameters: column - A String value to use as column. Parameters: year - An int with the year. Parameters: month - An int with the month. | public Criteria | addDate(String column, int year, int month, int date, SqlEnum comparison) Convenience method to add a Date object specified by
year, month, and date into the Criteria.
Equal to
add(column, new GregorianCalendar(year, month,date), comparison);
Parameters: column - The column to run the comparison on Parameters: year - An int with the year. Parameters: month - An int with the month. | public Criteria | addDescendingOrderByColumn(String name) Add order by column name, explicitly specifying descending.
Parameters: name - The name of the column to order by. | public Criteria | addGroupByColumn(String groupBy) Add group by column name.
Parameters: groupBy - The name of the column to group by. | public Criteria | addHaving(Criterion having) This method adds a prepared Criterion object to the Criteria as a having
clause. | public Criteria | addIn(String column, Object[] values) Adds an 'IN' clause with the criteria supplied as an Object
array. | public Criteria | addIn(String column, int[] values) Adds an 'IN' clause with the criteria supplied as an int array.
For example:
FOO.ID IN ('2', '3', '7')
where 'values' contains those three integers.
If a criterion for the requested column already exists, it is
replaced.
Parameters: column - The column to run the comparison on Parameters: values - An int[] with the allowed values. | public Criteria | addIn(String column, List values) Adds an 'IN' clause with the criteria supplied as a List.
For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - A List with the allowed values. | public Criteria | addJoin(String left, String right) This is the way that you should add a join of two tables. | public Criteria | addJoin(String left, String right, SqlEnum operator) This is the way that you should add a join of two tables. | public Criteria | addNotIn(String column, Object[] values) Adds a 'NOT IN' clause with the criteria supplied as an Object
array. | public Criteria | addNotIn(String column, int[] values) Adds a 'NOT IN' clause with the criteria supplied as an int
array. | public Criteria | addNotIn(String column, List values) Adds a 'NOT IN' clause with the criteria supplied as a List.
For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - A List with the disallowed values. | public Criteria | addSelectColumn(String name) Add select column.
Parameters: name - A String with the name of the select column. | public Criteria | and(Criterion c) This method adds a prepared Criterion object to the Criteria.
You can get a new, empty Criterion object with the
getNewCriterion() method. | public Criteria | and(String column, Object value) This method adds a new criterion to the list of criterias. | public Criteria | and(String column, Object value, SqlEnum comparison) This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
"AND"ed to the existing criterion. | public Criteria | and(String table, String column, Object value) This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
"AND"ed to the existing criterion. | public Criteria | and(String table, String column, Object value, SqlEnum comparison) This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
"AND"ed to the existing criterion. | public Criteria | and(String column, boolean value) Convenience method to add a boolean to Criteria.
Equal to
and(column, new Boolean(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A Boolean. | public Criteria | and(String column, boolean value, SqlEnum comparison) Convenience method to add a boolean to Criteria. | public Criteria | and(String column, int value) Convenience method to add an int to Criteria.
Equal to
and(column, new Integer(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - An int. | public Criteria | and(String column, int value, SqlEnum comparison) Convenience method to add an int to Criteria. | public Criteria | and(String column, long value) Convenience method to add a long to Criteria.
Equal to
and(column, new Long(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A long. | public Criteria | and(String column, long value, SqlEnum comparison) Convenience method to add a long to Criteria. | public Criteria | and(String column, float value) Convenience method to add a float to Criteria.
Equal to
and(column, new Float(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A float. | public Criteria | and(String column, float value, SqlEnum comparison) Convenience method to add a float to Criteria. | public Criteria | and(String column, double value) Convenience method to add a double to Criteria.
Equal to
and(column, new Double(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A double. | public Criteria | and(String column, double value, SqlEnum comparison) Convenience method to add a double to Criteria. | public Criteria | andDate(String column, int year, int month, int date) Convenience method to add a Date object specified by
year, month, and date into the Criteria.
Equal to
and(column, new GregorianCalendar(year, month,date), EQUAL);
Parameters: column - A String value to use as column. Parameters: year - An int with the year. Parameters: month - An int with the month. Parameters: date - An int with the date. | public Criteria | andDate(String column, int year, int month, int date, SqlEnum comparison) Convenience method to add a Date object specified by
year, month, and date into the Criteria. | public Criteria | andIn(String column, Object[] values) Adds an 'IN' clause with the criteria supplied as an Object array.
For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - An Object[] with the allowed values. | public Criteria | andIn(String column, int[] values) Adds an 'IN' clause with the criteria supplied as an int array.
For example:
FOO.ID IN ('2', '3', '7')
where 'values' contains those three integers.
If a criterion for the requested column already exists, it is
"AND"ed to the existing criterion.
Parameters: column - The column to run the comparison on Parameters: values - An int[] with the allowed values. | public Criteria | andIn(String column, List values) Adds an 'IN' clause with the criteria supplied as a List.
For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - A List with the allowed values. | public Criteria | andNotIn(String column, Object[] values) Adds a 'NOT IN' clause with the criteria supplied as an Object
array. | public Criteria | andNotIn(String column, int[] values) Adds a 'NOT IN' clause with the criteria supplied as an int
array. | public Criteria | andNotIn(String column, List values) Adds a 'NOT IN' clause with the criteria supplied as a List.
For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - A List with the disallowed values. | public void | clear() Brings this criteria back to its initial state, so that it
can be reused as if it was new. | public boolean | containsKey(String table, String column) Does this Criteria Object contain the specified key?
Parameters: table - The name of the table. Parameters: column - The name of the column. | public boolean | equals(Object crit) This method checks another Criteria to see if they contain
the same attributes and hashtable entries. | public Object | get(Object key) Overrides Hashtable get, so that the value placed in the
Criterion is returned instead of the Criterion.
Parameters: key - An Object. | public Map | getAliases() Get the table aliases. | public Map | getAsColumns() Get the column aliases. | public BigDecimal | getBigDecimal(String name) Convenience method to return a BigDecimal.
Parameters: name - A String with the name of the key. | public BigDecimal | getBigDecimal(String table, String column) Convenience method to return a BigDecimal.
Parameters: table - String name of table. Parameters: column - String name of column. | public boolean | getBoolean(String column) Convenience method to return value as a boolean.
Parameters: column - String name of column. | public boolean | getBoolean(String table, String column) Convenience method to return value as a boolean.
Parameters: table - String name of table. Parameters: column - String name of column. | public String | getColumnName(String name) Method to return a String table name.
Parameters: name - A String with the name of the key. | public SqlEnum | getComparison(String key) Method to return a comparison String.
Parameters: key - String name of the key. | public SqlEnum | getComparison(String table, String column) Method to return a comparison String.
Parameters: table - String name of table. Parameters: column - String name of column. | public Criterion | getCriterion(String column) Method to return criteria related to columns in a table.
Parameters: column - String name of column. | public Criterion | getCriterion(String table, String column) Method to return criteria related to a column in a table.
Parameters: table - String name of table. Parameters: column - String name of column. | public java.util.Date | getDate(String name) Convenience method to return a Date. | public java.util.Date | getDate(String table, String column) Convenience method to return a Date.
Parameters: table - String name of table. Parameters: column - String name of column. | public String | getDbName() Get the Database(Map) name.
A String with the Database(Map) name. | public double | getDouble(String name) Convenience method to return a double.
Parameters: name - A String with the name of the key. | public double | getDouble(String table, String column) Convenience method to return a double.
Parameters: table - String name of table. Parameters: column - String name of column. | public float | getFloat(String name) Convenience method to return a float.
Parameters: name - A String with the name of the key. | public float | getFloat(String table, String column) Convenience method to return a float.
Parameters: table - String name of table. Parameters: column - String name of column. | public UniqueList | getGroupByColumns() Get group by columns. | public Criterion | getHaving() Get Having Criterion. | public int | getInt(String name) Convenience method to return an int.
Parameters: name - A String with the name of the key. | public int | getInt(String table, String column) Convenience method to return an int.
Parameters: table - String name of table. Parameters: column - String name of column. | public Integer | getInteger(String name) Convenience method to return an Integer.
Parameters: name - A String with the name of the key. | public Integer | getInteger(String table, String column) Convenience method to return an Integer.
Parameters: table - String name of table. Parameters: column - String name of column. | public List | getJoinL() get one side of the set of possible joins. | public List | getJoinR() get one side of the set of possible joins. | public List | getJoins() get the List of Joins. | public int | getLimit() Get limit. | public List | getList(String name) Convenience method to return a List.
Parameters: name - A String with the name of the key. | public List | getList(String table, String column) Convenience method to return a List.
Parameters: table - String name of table. Parameters: column - String name of column. | public long | getLong(String name) Convenience method to return a long.
Parameters: name - A String with the name of the key. | public long | getLong(String table, String column) Convenience method to return a long.
Parameters: table - String name of table. Parameters: column - String name of column. | public Criterion | getNewCriterion(String column, Object value, SqlEnum comparison) Method to return criterion that is not added automatically
to this Criteria. | public Criterion | getNewCriterion(String table, String column, Object value, SqlEnum comparison) Method to return criterion that is not added automatically
to this Criteria. | public ObjectKey | getObjectKey(String name) Convenience method to return an ObjectKey.
Parameters: name - A String with the name of the key. | public ObjectKey | getObjectKey(String table, String column) Convenience method to return an ObjectKey.
Parameters: table - String name of table. Parameters: column - String name of column. | public int | getOffset() Get offset. | public UniqueList | getOrderByColumns() Get order by columns. | public UniqueList | getSelectColumns() Get select columns. | public UniqueList | getSelectModifiers() Get select modifiers. | public String | getString(String name) Convenience method to return a String.
Parameters: name - A String with the name of the key. | public String | getString(String table, String column) Convenience method to return a String.
Parameters: table - String name of table. Parameters: column - String name of column. | public String | getTableForAlias(String alias) Returns the table name associated with an alias. | public String | getTableName(String name) Method to return a String table name.
Parameters: name - A String with the name of the key. | public Object | getValue(String name) Method to return the value that was added to Criteria.
Parameters: name - A String with the name of the key. | public Object | getValue(String table, String column) Method to return the value that was added to Criteria.
Parameters: table - String name of table. Parameters: column - String name of column. | public int | hashCode() Returns the hash code value for this Join. | public boolean | isCascade() | public boolean | isIgnoreCase() | public boolean | isSingleRecord() | protected boolean | isUseTransaction() called by BasePeer to determine whether the sql command specified by
this criteria must be wrapped in a transaction. | public Criteria | or(Criterion c) This method adds a prepared Criterion object to the Criteria.
You can get a new, empty Criterion object with the
getNewCriterion() method. | public Criteria | or(String column, Object value) This method adds a new criterion to the list of criterias. | public Criteria | or(String column, Object value, SqlEnum comparison) This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
"OR"ed to the existing criterion. | public Criteria | or(String table, String column, Object value) This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
"OR"ed to the existing criterion. | public Criteria | or(String table, String column, Object value, SqlEnum comparison) This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
"OR"ed to the existing criterion. | public Criteria | or(String column, boolean value) Convenience method to add a boolean to Criteria.
Equal to
or(column, new Boolean(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A Boolean. | public Criteria | or(String column, boolean value, SqlEnum comparison) Convenience method to add a boolean to Criteria. | public Criteria | or(String column, int value) Convenience method to add an int to Criteria.
Equal to
or(column, new Integer(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - An int. | public Criteria | or(String column, int value, SqlEnum comparison) Convenience method to add an int to Criteria. | public Criteria | or(String column, long value) Convenience method to add a long to Criteria.
Equal to
or(column, new Long(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A long. | public Criteria | or(String column, long value, SqlEnum comparison) Convenience method to add a long to Criteria. | public Criteria | or(String column, float value) Convenience method to add a float to Criteria.
Equal to
or(column, new Float(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A float. | public Criteria | or(String column, float value, SqlEnum comparison) Convenience method to add a float to Criteria. | public Criteria | or(String column, double value) Convenience method to add a double to Criteria.
Equal to
or(column, new Double(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A double. | public Criteria | or(String column, double value, SqlEnum comparison) Convenience method to add a double to Criteria. | public Criteria | orDate(String column, int year, int month, int date) Convenience method to add a Date object specified by
year, month, and date into the Criteria.
Equal to
or(column, new GregorianCalendar(year, month,date), EQUAL);
Parameters: column - A String value to use as column. Parameters: year - An int with the year. Parameters: month - An int with the month. Parameters: date - An int with the date. | public Criteria | orDate(String column, int year, int month, int date, SqlEnum comparison) Convenience method to add a Date object specified by
year, month, and date into the Criteria. | public Criteria | orIn(String column, Object[] values) Adds an 'IN' clause with the criteria supplied as an Object
array. | public Criteria | orIn(String column, int[] values) Adds an 'IN' clause with the criteria supplied as an int array.
For example:
FOO.ID IN ('2', '3', '7')
where 'values' contains those three integers.
If a criterion for the requested column already exists, it is
"OR"ed to the existing criterion.
Parameters: column - The column to run the comparison on Parameters: values - An int[] with the allowed values. | public Criteria | orIn(String column, List values) Adds an 'IN' clause with the criteria supplied as a List.
For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - A List with the allowed values. | public Criteria | orNotIn(String column, Object[] values) Adds a 'NOT IN' clause with the criteria supplied as an Object
array. | public Criteria | orNotIn(String column, int[] values) Adds a 'NOT IN' clause with the criteria supplied as an int
array. | public Criteria | orNotIn(String column, List values) Adds a 'NOT IN' clause with the criteria supplied as a List.
For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - A List with the disallowed values. | public Object | put(Object key, Object value) Overrides Hashtable put, so that this object is returned
instead of the value previously in the Criteria object.
The reason is so that it more closely matches the behavior
of the add() methods. | public synchronized void | putAll(Map t) 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. | public Object | remove(String key) Remove an object from the criteria.
Parameters: key - A String with the key to be removed. | public void | setAll() Adds "ALL " to the SQL statement. | public Criteria | setCascade(boolean b) Set cascade.
Parameters: b - True if cascade is set. | public void | setDbName(String dbName) Set the DatabaseMap name. | public void | setDistinct() Adds "DISTINCT " to the SQL statement. | public Criteria | setIgnoreCase(boolean b) Sets ignore case.
Parameters: b - True if case should be ignored. | public Criteria | setLimit(int limit) Set limit.
Parameters: limit - An int with the value for limit. | public Criteria | setOffset(int offset) Set offset.
Parameters: offset - An int with the value for offset. | public Criteria | setSingleRecord(boolean b) 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). | public void | setUseTransaction(boolean v) Will force the sql represented by this criteria to be executed within
a transaction. | public String | toString() Build a string representation of the Criteria. |
ALT_NOT_EQUAL | final public static SqlEnum ALT_NOT_EQUAL(Code) | | Comparison type.
|
CURRENT_DATE | final public static SqlEnum CURRENT_DATE(Code) | | "CURRENT_DATE" ANSI SQL function
|
CURRENT_TIME | final public static SqlEnum CURRENT_TIME(Code) | | "CURRENT_TIME" ANSI SQL function
|
DISTINCT | final public static SqlEnum DISTINCT(Code) | | Comparison type.
|
GREATER_EQUAL | final public static SqlEnum GREATER_EQUAL(Code) | | Comparison type.
|
GREATER_THAN | final public static SqlEnum GREATER_THAN(Code) | | Comparison type.
|
INNER_JOIN | final public static SqlEnum INNER_JOIN(Code) | | "INNER JOIN" SQL statement
|
ISNOTNULL | final public static SqlEnum ISNOTNULL(Code) | | "IS NOT NULL" null comparison
|
ISNULL | final public static SqlEnum ISNULL(Code) | | "IS NULL" null comparison
|
LEFT_JOIN | final public static SqlEnum LEFT_JOIN(Code) | | "LEFT JOIN" SQL statement
|
LESS_EQUAL | final public static SqlEnum LESS_EQUAL(Code) | | Comparison type.
|
LESS_THAN | final public static SqlEnum LESS_THAN(Code) | | Comparison type.
|
NOT_EQUAL | final public static SqlEnum NOT_EQUAL(Code) | | Comparison type.
|
NOT_ILIKE | final public static SqlEnum NOT_ILIKE(Code) | | Comparison type.
|
NOT_LIKE | final public static SqlEnum NOT_LIKE(Code) | | Comparison type.
|
RIGHT_JOIN | final public static SqlEnum RIGHT_JOIN(Code) | | "RIGHT JOIN" SQL statement
|
Criteria | public Criteria()(Code) | | Creates a new instance with the default capacity.
|
Criteria | public Criteria(int initialCapacity)(Code) | | Creates a new instance with the specified capacity.
Parameters: initialCapacity - An int. |
Criteria | public Criteria(String dbName)(Code) | | Creates a new instance with the default capacity which corresponds to
the specified database.
Parameters: dbName - The dabase name. |
Criteria | public Criteria(String dbName, int initialCapacity)(Code) | | Creates a new instance with the specified capacity which corresponds to
the specified database.
Parameters: dbName - The dabase name. Parameters: initialCapacity - The initial capacity. |
add | public Criteria add(Criterion c)(Code) | | This method adds a prepared Criterion object to the Criteria.
You can get a new, empty Criterion object with the
getNewCriterion() method. If a criterion for the requested column
already exists, it is replaced. This is used as follows:
Criteria crit = new Criteria();
Criteria.Criterion c = crit
.getNewCriterion(BasePeer.ID, new Integer(5), Criteria.LESS_THAN);
crit.add(c);
Parameters: c - A Criterion object A modified Criteria object. |
add | public Criteria add(String column, Object value)(Code) | | This method adds a new criterion to the list of criterias. If a
criterion for the requested column already exists, it is
replaced. This is used as follows:
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.
Parameters: column - The column to run the comparison on Parameters: value - An Object. A modified Criteria object. |
add | public Criteria add(String column, Object value, SqlEnum comparison)(Code) | | This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
replaced. If is used as follow:
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.
Parameters: column - The column to run the comparison on Parameters: value - An Object. Parameters: comparison - A String. A modified Criteria object. |
add | public Criteria add(String table, String column, Object value)(Code) | | This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
replaced. If is used as follows:
Criteria crit = new Criteria().add("table",
"column",
"value");
An EQUAL comparison is used for column and value.
Parameters: table - Name of the table which contains the column Parameters: column - The column to run the comparison on Parameters: value - An Object. A modified Criteria object. |
add | public Criteria add(String table, String column, Object value, SqlEnum comparison)(Code) | | This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
replaced. If is used as follows:
Criteria crit = new Criteria().add("table",
"column",
"value",
Criteria.GREATER_THAN);
Any comparison can be used.
Parameters: table - Name of table which contains the column Parameters: column - The column to run the comparison on Parameters: value - An Object. Parameters: comparison - String describing how to compare the column withthe value A modified Criteria object. |
add | public Criteria add(String column, boolean value)(Code) | | Convenience method to add a boolean to Criteria.
Equal to
add(column, new Boolean(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A Boolean. A modified Criteria object. |
add | public Criteria add(String column, boolean value, SqlEnum comparison)(Code) | | Convenience method to add a boolean to Criteria.
Equal to
add(column, new Boolean(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - A Boolean. Parameters: comparison - String describing how to compare the column withthe value A modified Criteria object. |
add | public Criteria add(String column, int value)(Code) | | Convenience method to add an int to Criteria.
Equal to
add(column, new Integer(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - An int. A modified Criteria object. |
add | public Criteria add(String column, int value, SqlEnum comparison)(Code) | | Convenience method to add an int to Criteria.
Equal to
add(column, new Integer(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - An int. Parameters: comparison - String describing how to compare the column withthe value A modified Criteria object. |
add | public Criteria add(String column, long value)(Code) | | Convenience method to add a long to Criteria.
Equal to
add(column, new Long(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A long. A modified Criteria object. |
add | public Criteria add(String column, long value, SqlEnum comparison)(Code) | | Convenience method to add a long to Criteria.
Equal to
add(column, new Long(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - A long. Parameters: comparison - String describing how to compare the column withthe value A modified Criteria object. |
add | public Criteria add(String column, float value)(Code) | | Convenience method to add a float to Criteria.
Equal to
add(column, new Float(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A float. A modified Criteria object. |
add | public Criteria add(String column, float value, SqlEnum comparison)(Code) | | Convenience method to add a float to Criteria.
Equal to
add(column, new Float(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - A float. Parameters: comparison - String describing how to compare the column withthe value A modified Criteria object. |
add | public Criteria add(String column, double value)(Code) | | Convenience method to add a double to Criteria.
Equal to
add(column, new Double(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A double. A modified Criteria object. |
add | public Criteria add(String column, double value, SqlEnum comparison)(Code) | | Convenience method to add a double to Criteria.
Equal to
add(column, new Double(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - A double. Parameters: comparison - String describing how to compare the column withthe value A modified Criteria object. |
addAlias | public void addAlias(String alias, String table)(Code) | | Allows one to specify an alias for a table that can
be used in various parts of the SQL.
Parameters: alias - a String value Parameters: table - a String value |
addAsColumn | public Criteria addAsColumn(String name, String clause)(Code) | | Add an AS clause to the select columns. Usage:
Criteria myCrit = new Criteria();
myCrit.addAsColumn("alias", "ALIAS("+MyPeer.ID+")");
Parameters: name - wanted Name of the column Parameters: clause - SQL clause to select from the tableIf the name already exists, it is replaced by the new clause. A modified Criteria object. |
addAscendingOrderByColumn | public Criteria addAscendingOrderByColumn(String name)(Code) | | Add order by column name, explicitly specifying ascending.
Parameters: name - The name of the column to order by. A modified Criteria object. |
addDate | public Criteria addDate(String column, int year, int month, int date)(Code) | | Convenience method to add a Date object specified by
year, month, and date into the Criteria.
Equal to
add(column, new GregorianCalendar(year, month,date), EQUAL);
Parameters: column - A String value to use as column. Parameters: year - An int with the year. Parameters: month - An int with the month. Month value is 0-based.e.g., 0 for January Parameters: date - An int with the date. A modified Criteria object. |
addDate | public Criteria addDate(String column, int year, int month, int date, SqlEnum comparison)(Code) | | Convenience method to add a Date object specified by
year, month, and date into the Criteria.
Equal to
add(column, new GregorianCalendar(year, month,date), comparison);
Parameters: column - The column to run the comparison on Parameters: year - An int with the year. Parameters: month - An int with the month. Month value is 0-based.e.g., 0 for January Parameters: date - An int with the date. Parameters: comparison - String describing how to compare the column withthe value A modified Criteria object. |
addDescendingOrderByColumn | public Criteria addDescendingOrderByColumn(String name)(Code) | | Add order by column name, explicitly specifying descending.
Parameters: name - The name of the column to order by. A modified Criteria object. |
addGroupByColumn | public Criteria addGroupByColumn(String groupBy)(Code) | | Add group by column name.
Parameters: groupBy - The name of the column to group by. A modified Criteria object. |
addHaving | public Criteria addHaving(Criterion having)(Code) | | This method adds a prepared Criterion object to the Criteria as a having
clause. You can get a new, empty Criterion object with the
getNewCriterion() method.
Criteria crit = new Criteria();
Criteria.Criterion c = crit.getNewCriterion(BasePeer.ID, new Integer(5),
Criteria.LESS_THAN);
crit.addHaving(c);
Parameters: having - A Criterion object A modified Criteria object. |
addIn | public Criteria addIn(String column, Object[] values)(Code) | | Adds an 'IN' clause with the criteria supplied as an Object
array. For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - An Object[] with the allowed values. A modified Criteria object. |
addIn | public Criteria addIn(String column, int[] values)(Code) | | Adds an 'IN' clause with the criteria supplied as an int array.
For example:
FOO.ID IN ('2', '3', '7')
where 'values' contains those three integers.
If a criterion for the requested column already exists, it is
replaced.
Parameters: column - The column to run the comparison on Parameters: values - An int[] with the allowed values. A modified Criteria object. |
addIn | public Criteria addIn(String column, List values)(Code) | | Adds an 'IN' clause with the criteria supplied as a List.
For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - A List with the allowed values. A modified Criteria object. |
addJoin | public Criteria addJoin(String left, String right)(Code) | | This is the way that you should add a join of two tables. For
example:
AND PROJECT.PROJECT_ID=FOO.PROJECT_ID
left = PROJECT.PROJECT_ID
right = FOO.PROJECT_ID
Parameters: left - A String with the left side of the join. Parameters: right - A String with the right side of the join. A modified Criteria object. |
addJoin | public Criteria addJoin(String left, String right, SqlEnum operator)(Code) | | This is the way that you should add a join of two tables. For
example:
PROJECT LEFT JOIN FOO ON PROJECT.PROJECT_ID=FOO.PROJECT_ID
left = "PROJECT.PROJECT_ID"
right = "FOO.PROJECT_ID"
operator = Criteria.LEFT_JOIN
Parameters: left - A String with the left side of the join. Parameters: right - A String with the right side of the join. Parameters: operator - The operator used for the join: must be one of null,Criteria.LEFT_JOIN, Criteria.RIGHT_JOIN, Criteria.INNER_JOIN A modified Criteria object. |
addNotIn | public Criteria addNotIn(String column, Object[] values)(Code) | | Adds a 'NOT IN' clause with the criteria supplied as an Object
array. For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - An Object[] with the disallowed values. A modified Criteria object. |
addNotIn | public Criteria addNotIn(String column, int[] values)(Code) | | Adds a 'NOT IN' clause with the criteria supplied as an int
array. For example:
FOO.ID NOT IN ('2', '3', '7')
where 'values' contains those three integers.
If a criterion for the requested column already exists, it is
replaced.
Parameters: column - The column to run the comparison on Parameters: values - An int[] with the disallowed values. A modified Criteria object. |
addNotIn | public Criteria addNotIn(String column, List values)(Code) | | Adds a 'NOT IN' clause with the criteria supplied as a List.
For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - A List with the disallowed values. A modified Criteria object. |
addSelectColumn | public Criteria addSelectColumn(String name)(Code) | | Add select column.
Parameters: name - A String with the name of the select column. A modified Criteria object. |
and | public Criteria and(Criterion c)(Code) | | This method adds a prepared Criterion object to the Criteria.
You can get a new, empty Criterion object with the
getNewCriterion() method. If a criterion for the requested column
already exists, it is "AND"ed to the existing criterion.
This is used as follows:
Criteria crit = new Criteria();
Criteria.Criterion c = crit.getNewCriterion(BasePeer.ID, new Integer(5),
Criteria.LESS_THAN);
crit.and(c);
Parameters: c - A Criterion object A modified Criteria object. |
and | public Criteria and(String column, Object value)(Code) | | This method adds a new criterion to the list of criterias. If a
criterion for the requested column already exists, it is
"AND"ed to the existing criterion. This is used as follows:
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.
Parameters: column - The column to run the comparison on Parameters: value - An Object. A modified Criteria object. |
and | public Criteria and(String column, Object value, SqlEnum comparison)(Code) | | This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
"AND"ed to the existing criterion. If is used as follow:
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.
Parameters: column - The column to run the comparison on Parameters: value - An Object. Parameters: comparison - A String. A modified Criteria object. |
and | public Criteria and(String table, String column, Object value)(Code) | | This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
"AND"ed to the existing criterion. If is used as follows:
Criteria crit = new Criteria().and("table",
"column",
"value");
An EQUAL comparison is used for column and value.
Parameters: table - Name of the table which contains the column Parameters: column - The column to run the comparison on Parameters: value - An Object. A modified Criteria object. |
and | public Criteria and(String table, String column, Object value, SqlEnum comparison)(Code) | | This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
"AND"ed to the existing criterion. If is used as follows:
Criteria crit = new Criteria().and("table",
"column",
"value",
"Criterion.GREATER_THAN");
Any comparison can be used.
Parameters: table - Name of table which contains the column Parameters: column - The column to run the comparison on Parameters: value - An Object. Parameters: comparison - String describing how to compare the column withthe value A modified Criteria object. |
and | public Criteria and(String column, boolean value)(Code) | | Convenience method to add a boolean to Criteria.
Equal to
and(column, new Boolean(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A Boolean. A modified Criteria object. |
and | public Criteria and(String column, boolean value, SqlEnum comparison)(Code) | | Convenience method to add a boolean to Criteria.
Equal to
and(column, new Boolean(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - A Boolean. Parameters: comparison - String describing how to compare the columnwith the value A modified Criteria object. |
and | public Criteria and(String column, int value)(Code) | | Convenience method to add an int to Criteria.
Equal to
and(column, new Integer(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - An int. A modified Criteria object. |
and | public Criteria and(String column, int value, SqlEnum comparison)(Code) | | Convenience method to add an int to Criteria.
Equal to
and(column, new Integer(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - An int. Parameters: comparison - String describing how to compare the column with the value A modified Criteria object. |
and | public Criteria and(String column, long value)(Code) | | Convenience method to add a long to Criteria.
Equal to
and(column, new Long(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A long. A modified Criteria object. |
and | public Criteria and(String column, long value, SqlEnum comparison)(Code) | | Convenience method to add a long to Criteria.
Equal to
and(column, new Long(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - A long. Parameters: comparison - String describing how to compare the column withthe value A modified Criteria object. |
and | public Criteria and(String column, float value)(Code) | | Convenience method to add a float to Criteria.
Equal to
and(column, new Float(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A float. A modified Criteria object. |
and | public Criteria and(String column, float value, SqlEnum comparison)(Code) | | Convenience method to add a float to Criteria.
Equal to
and(column, new Float(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - A float. Parameters: comparison - String describing how to compare the column withthe value A modified Criteria object. |
and | public Criteria and(String column, double value)(Code) | | Convenience method to add a double to Criteria.
Equal to
and(column, new Double(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A double. A modified Criteria object. |
and | public Criteria and(String column, double value, SqlEnum comparison)(Code) | | Convenience method to add a double to Criteria.
Equal to
and(column, new Double(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - A double. Parameters: comparison - String describing how to compare the column withthe value A modified Criteria object. |
andDate | public Criteria andDate(String column, int year, int month, int date)(Code) | | Convenience method to add a Date object specified by
year, month, and date into the Criteria.
Equal to
and(column, new GregorianCalendar(year, month,date), EQUAL);
Parameters: column - A String value to use as column. Parameters: year - An int with the year. Parameters: month - An int with the month. Parameters: date - An int with the date. A modified Criteria object. |
andDate | public Criteria andDate(String column, int year, int month, int date, SqlEnum comparison)(Code) | | Convenience method to add a Date object specified by
year, month, and date into the Criteria.
Equal to
and(column, new GregorianCalendar(year, month,date), comparison);
Parameters: column - The column to run the comparison on Parameters: year - An int with the year. Parameters: month - An int with the month. Parameters: date - An int with the date. Parameters: comparison - String describing how to compare the column withthe value A modified Criteria object. |
andIn | public Criteria andIn(String column, Object[] values)(Code) | | Adds an 'IN' clause with the criteria supplied as an Object array.
For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - An Object[] with the allowed values. A modified Criteria object. |
andIn | public Criteria andIn(String column, int[] values)(Code) | | Adds an 'IN' clause with the criteria supplied as an int array.
For example:
FOO.ID IN ('2', '3', '7')
where 'values' contains those three integers.
If a criterion for the requested column already exists, it is
"AND"ed to the existing criterion.
Parameters: column - The column to run the comparison on Parameters: values - An int[] with the allowed values. A modified Criteria object. |
andIn | public Criteria andIn(String column, List values)(Code) | | Adds an 'IN' clause with the criteria supplied as a List.
For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - A List with the allowed values. A modified Criteria object. |
andNotIn | public Criteria andNotIn(String column, Object[] values)(Code) | | Adds a 'NOT IN' clause with the criteria supplied as an Object
array. For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - An Object[] with the disallowed values. A modified Criteria object. |
andNotIn | public Criteria andNotIn(String column, int[] values)(Code) | | Adds a 'NOT IN' clause with the criteria supplied as an int
array. For example:
FOO.ID NOT IN ('2', '3', '7')
where 'values' contains those three integers.
If a criterion for the requested column already exists, it is
"AND"ed to the existing criterion.
Parameters: column - The column to run the comparison on Parameters: values - An int[] with the disallowed values. A modified Criteria object. |
andNotIn | public Criteria andNotIn(String column, List values)(Code) | | Adds a 'NOT IN' clause with the criteria supplied as a List.
For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - A List with the disallowed values. A modified Criteria object. |
clear | public void clear()(Code) | | Brings this criteria back to its initial state, so that it
can be reused as if it was new. Except if the criteria has grown in
capacity, it is left at the current capacity.
|
containsKey | public boolean containsKey(String table, String column)(Code) | | Does this Criteria Object contain the specified key?
Parameters: table - The name of the table. Parameters: column - The name of the column. True if this Criteria Object contain the specified key. |
equals | public boolean equals(Object crit)(Code) | | This method checks another Criteria to see if they contain
the same attributes and hashtable entries.
|
get | public Object get(Object key)(Code) | | Overrides Hashtable get, so that the value placed in the
Criterion is returned instead of the Criterion.
Parameters: key - An Object. An Object. |
getAliases | public Map getAliases()(Code) | | Get the table aliases.
A Map which maps the table alias names to the actual table names. |
getAsColumns | public Map getAsColumns()(Code) | | Get the column aliases.
A Map which map the column alias namesto the alias clauses. |
getBigDecimal | public BigDecimal getBigDecimal(String name)(Code) | | Convenience method to return a BigDecimal.
Parameters: name - A String with the name of the key. A BigDecimal with the value of object at key. |
getBigDecimal | public BigDecimal getBigDecimal(String table, String column)(Code) | | Convenience method to return a BigDecimal.
Parameters: table - String name of table. Parameters: column - String name of column. A BigDecimal with the value of object at key. |
getBoolean | public boolean getBoolean(String column)(Code) | | Convenience method to return value as a boolean.
Parameters: column - String name of column. A boolean. |
getBoolean | public boolean getBoolean(String table, String column)(Code) | | Convenience method to return value as a boolean.
Parameters: table - String name of table. Parameters: column - String name of column. A boolean. |
getColumnName | public String getColumnName(String name)(Code) | | Method to return a String table name.
Parameters: name - A String with the name of the key. A String with the value of the object at key. |
getComparison | public SqlEnum getComparison(String key)(Code) | | Method to return a comparison String.
Parameters: key - String name of the key. A String with the value of the object at key. |
getComparison | public SqlEnum getComparison(String table, String column)(Code) | | Method to return a comparison String.
Parameters: table - String name of table. Parameters: column - String name of column. A String with the value of the object at key. |
getCriterion | public Criterion getCriterion(String column)(Code) | | Method to return criteria related to columns in a table.
Parameters: column - String name of column. A Criterion. |
getCriterion | public Criterion getCriterion(String table, String column)(Code) | | Method to return criteria related to a column in a table.
Parameters: table - String name of table. Parameters: column - String name of column. A Criterion. |
getDate | public java.util.Date getDate(String name)(Code) | | Convenience method to return a Date.
Parameters: name - column name (TABLE.COLUMN) A java.util.Date with the value of object at key. |
getDate | public java.util.Date getDate(String table, String column)(Code) | | Convenience method to return a Date.
Parameters: table - String name of table. Parameters: column - String name of column. A java.util.Date with the value of object at key. |
getDbName | public String getDbName()(Code) | | Get the Database(Map) name.
A String with the Database(Map) name. By default, thisis PoolBrokerService.DEFAULT. |
getDouble | public double getDouble(String name)(Code) | | Convenience method to return a double.
Parameters: name - A String with the name of the key. A double with the value of object at key. |
getDouble | public double getDouble(String table, String column)(Code) | | Convenience method to return a double.
Parameters: table - String name of table. Parameters: column - String name of column. A double with the value of object at key. |
getFloat | public float getFloat(String name)(Code) | | Convenience method to return a float.
Parameters: name - A String with the name of the key. A float with the value of object at key. |
getFloat | public float getFloat(String table, String column)(Code) | | Convenience method to return a float.
Parameters: table - String name of table. Parameters: column - String name of column. A float with the value of object at key. |
getGroupByColumns | public UniqueList getGroupByColumns()(Code) | | Get group by columns.
An UniqueList with the name of the groupBy clause. |
getHaving | public Criterion getHaving()(Code) | | Get Having Criterion.
A Criterion that is the having clause. |
getInt | public int getInt(String name)(Code) | | Convenience method to return an int.
Parameters: name - A String with the name of the key. An int with the value of object at key. |
getInt | public int getInt(String table, String column)(Code) | | Convenience method to return an int.
Parameters: table - String name of table. Parameters: column - String name of column. An int with the value of object at key. |
getInteger | public Integer getInteger(String name)(Code) | | Convenience method to return an Integer.
Parameters: name - A String with the name of the key. An Integer with the value of object at key. |
getInteger | public Integer getInteger(String table, String column)(Code) | | Convenience method to return an Integer.
Parameters: table - String name of table. Parameters: column - String name of column. An Integer with the value of object at key. |
getJoinL | public List getJoinL()(Code) | | get one side of the set of possible joins. This method is meant to
be called by BasePeer.
|
getJoinR | public List getJoinR()(Code) | | get one side of the set of possible joins. This method is meant to
be called by BasePeer.
|
getJoins | public List getJoins()(Code) | | get the List of Joins. This method is meant to
be called by BasePeer.
a List which contains objects of type Join.If the criteria does not contains any joins, the list is empty |
getLimit | public int getLimit()(Code) | | Get limit.
An int with the value for limit. |
getList | public List getList(String name)(Code) | | Convenience method to return a List.
Parameters: name - A String with the name of the key. A List with the value of object at key. |
getList | public List getList(String table, String column)(Code) | | Convenience method to return a List.
Parameters: table - String name of table. Parameters: column - String name of column. A List with the value of object at key. |
getLong | public long getLong(String name)(Code) | | Convenience method to return a long.
Parameters: name - A String with the name of the key. A long with the value of object at key. |
getLong | public long getLong(String table, String column)(Code) | | Convenience method to return a long.
Parameters: table - String name of table. Parameters: column - String name of column. A long with the value of object at key. |
getNewCriterion | public Criterion getNewCriterion(String column, Object value, SqlEnum comparison)(Code) | | Method to return criterion that is not added automatically
to this Criteria. This can be used to chain the
Criterions to form a more complex where clause.
Parameters: column - String full name of column (for example TABLE.COLUMN). A Criterion. |
getNewCriterion | public Criterion getNewCriterion(String table, String column, Object value, SqlEnum comparison)(Code) | | Method to return criterion that is not added automatically
to this Criteria. This can be used to chain the
Criterions to form a more complex where clause.
Parameters: table - String name of table. Parameters: column - String name of column. A Criterion. |
getObjectKey | public ObjectKey getObjectKey(String name)(Code) | | Convenience method to return an ObjectKey.
Parameters: name - A String with the name of the key. An ObjectKey with the value of object at key. |
getObjectKey | public ObjectKey getObjectKey(String table, String column)(Code) | | Convenience method to return an ObjectKey.
Parameters: table - String name of table. Parameters: column - String name of column. A String with the value of object at key. |
getOffset | public int getOffset()(Code) | | Get offset.
An int with the value for offset. |
getOrderByColumns | public UniqueList getOrderByColumns()(Code) | | Get order by columns.
An UniqueList with the name of the order columns. |
getSelectColumns | public UniqueList getSelectColumns()(Code) | | Get select columns.
An StringStack with the name of the selectcolumns. |
getSelectModifiers | public UniqueList getSelectModifiers()(Code) | | Get select modifiers.
An UniqueList with the select modifiers. |
getString | public String getString(String name)(Code) | | Convenience method to return a String.
Parameters: name - A String with the name of the key. A String with the value of object at key. |
getString | public String getString(String table, String column)(Code) | | Convenience method to return a String.
Parameters: table - String name of table. Parameters: column - String name of column. A String with the value of object at key. |
getTableForAlias | public String getTableForAlias(String alias)(Code) | | Returns the table name associated with an alias.
Parameters: alias - a String value a String value |
getTableName | public String getTableName(String name)(Code) | | Method to return a String table name.
Parameters: name - A String with the name of the key. A String with the value of object at key. |
getValue | public Object getValue(String name)(Code) | | Method to return the value that was added to Criteria.
Parameters: name - A String with the name of the key. An Object with the value of object at key. |
getValue | public Object getValue(String table, String column)(Code) | | Method to return the value that was added to Criteria.
Parameters: table - String name of table. Parameters: column - String name of column. An Object with the value of object at key. |
hashCode | public int hashCode()(Code) | | Returns the hash code value for this Join.
a hash code value for this object. |
isCascade | public boolean isCascade()(Code) | | Is cascade set?
True if cascade is set. |
isIgnoreCase | public boolean isIgnoreCase()(Code) | | Is ignore case on or off?
True if case is ignored. |
isSingleRecord | public boolean isSingleRecord()(Code) | | Is single record?
True if a single record is being returned. |
isUseTransaction | protected boolean isUseTransaction()(Code) | | called by BasePeer to determine whether the sql command specified by
this criteria must be wrapped in a transaction.
a boolean value |
or | public Criteria or(Criterion c)(Code) | | This method adds a prepared Criterion object to the Criteria.
You can get a new, empty Criterion object with the
getNewCriterion() method. If a criterion for the requested column
already exists, it is "OR"ed to the existing criterion.
This is used as follows:
Criteria crit = new Criteria();
Criteria.Criterion c = crit.getNewCriterion(BasePeer.ID, new Integer(5), Criteria.LESS_THAN);
crit.or(c);
Parameters: c - A Criterion object A modified Criteria object. |
or | public Criteria or(String column, Object value)(Code) | | This method adds a new criterion to the list of criterias. If a
criterion for the requested column already exists, it is
"OR"ed to the existing criterion. This is used as follows:
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.
Parameters: column - The column to run the comparison on Parameters: value - An Object. A modified Criteria object. |
or | public Criteria or(String column, Object value, SqlEnum comparison)(Code) | | This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
"OR"ed to the existing criterion. If is used as follow:
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.
Parameters: column - The column to run the comparison on Parameters: value - An Object. Parameters: comparison - A String. A modified Criteria object. |
or | public Criteria or(String table, String column, Object value)(Code) | | This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
"OR"ed to the existing criterion. If is used as follows:
Criteria crit = new Criteria().or("table",
"column",
"value");
An EQUAL comparison is used for column and value.
Parameters: table - Name of the table which contains the column Parameters: column - The column to run the comparison on Parameters: value - An Object. A modified Criteria object. |
or | public Criteria or(String table, String column, Object value, SqlEnum comparison)(Code) | | This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
"OR"ed to the existing criterion. If is used as follows:
Criteria crit = new Criteria().or("table",
"column",
"value",
"Criterion.GREATER_THAN");
Any comparison can be used.
Parameters: table - Name of table which contains the column Parameters: column - The column to run the comparison on Parameters: value - An Object. Parameters: comparison - String describing how to compare the column with the value A modified Criteria object. |
or | public Criteria or(String column, boolean value)(Code) | | Convenience method to add a boolean to Criteria.
Equal to
or(column, new Boolean(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A Boolean. A modified Criteria object. |
or | public Criteria or(String column, boolean value, SqlEnum comparison)(Code) | | Convenience method to add a boolean to Criteria.
Equal to
or(column, new Boolean(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - A Boolean. Parameters: comparison - String describing how to compare the columnwith the value A modified Criteria object. |
or | public Criteria or(String column, int value)(Code) | | Convenience method to add an int to Criteria.
Equal to
or(column, new Integer(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - An int. A modified Criteria object. |
or | public Criteria or(String column, int value, SqlEnum comparison)(Code) | | Convenience method to add an int to Criteria.
Equal to
or(column, new Integer(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - An int. Parameters: comparison - String describing how to compare the columnwith the value A modified Criteria object. |
or | public Criteria or(String column, long value)(Code) | | Convenience method to add a long to Criteria.
Equal to
or(column, new Long(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A long. A modified Criteria object. |
or | public Criteria or(String column, long value, SqlEnum comparison)(Code) | | Convenience method to add a long to Criteria.
Equal to
or(column, new Long(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - A long. Parameters: comparison - String describing how to compare the columnwith the value A modified Criteria object. |
or | public Criteria or(String column, float value)(Code) | | Convenience method to add a float to Criteria.
Equal to
or(column, new Float(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A float. A modified Criteria object. |
or | public Criteria or(String column, float value, SqlEnum comparison)(Code) | | Convenience method to add a float to Criteria.
Equal to
or(column, new Float(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - A float. Parameters: comparison - String describing how to compare the columnwith the value A modified Criteria object. |
or | public Criteria or(String column, double value)(Code) | | Convenience method to add a double to Criteria.
Equal to
or(column, new Double(value), EQUAL);
Parameters: column - The column to run the comparison on Parameters: value - A double. A modified Criteria object. |
or | public Criteria or(String column, double value, SqlEnum comparison)(Code) | | Convenience method to add a double to Criteria.
Equal to
or(column, new Double(value), comparison);
Parameters: column - The column to run the comparison on Parameters: value - A double. Parameters: comparison - String describing how to compare the columnwith the value A modified Criteria object. |
orDate | public Criteria orDate(String column, int year, int month, int date)(Code) | | Convenience method to add a Date object specified by
year, month, and date into the Criteria.
Equal to
or(column, new GregorianCalendar(year, month,date), EQUAL);
Parameters: column - A String value to use as column. Parameters: year - An int with the year. Parameters: month - An int with the month. Parameters: date - An int with the date. A modified Criteria object. |
orDate | public Criteria orDate(String column, int year, int month, int date, SqlEnum comparison)(Code) | | Convenience method to add a Date object specified by
year, month, and date into the Criteria.
Equal to
or(column, new GregorianCalendar(year, month,date), comparison);
Parameters: column - The column to run the comparison on Parameters: year - An int with the year. Parameters: month - An int with the month. Parameters: date - An int with the date. Parameters: comparison - String describing how to compare the columnwith the value A modified Criteria object. |
orIn | public Criteria orIn(String column, Object[] values)(Code) | | Adds an 'IN' clause with the criteria supplied as an Object
array. For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - An Object[] with the allowed values. A modified Criteria object. |
orIn | public Criteria orIn(String column, int[] values)(Code) | | Adds an 'IN' clause with the criteria supplied as an int array.
For example:
FOO.ID IN ('2', '3', '7')
where 'values' contains those three integers.
If a criterion for the requested column already exists, it is
"OR"ed to the existing criterion.
Parameters: column - The column to run the comparison on Parameters: values - An int[] with the allowed values. A modified Criteria object. |
orIn | public Criteria orIn(String column, List values)(Code) | | Adds an 'IN' clause with the criteria supplied as a List.
For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - A List with the allowed values. A modified Criteria object. |
orNotIn | public Criteria orNotIn(String column, Object[] values)(Code) | | Adds a 'NOT IN' clause with the criteria supplied as an Object
array. For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - An Object[] with the disallowed values. A modified Criteria object. |
orNotIn | public Criteria orNotIn(String column, int[] values)(Code) | | Adds a 'NOT IN' clause with the criteria supplied as an int
array. For example:
FOO.ID NOT IN ('2', '3', '7')
where 'values' contains those three integers.
If a criterion for the requested column already exists, it is
"OR"ed to the existing criterion.
Parameters: column - The column to run the comparison on Parameters: values - An int[] with the disallowed values. A modified Criteria object. |
orNotIn | public Criteria orNotIn(String column, List values)(Code) | | Adds a 'NOT IN' clause with the criteria supplied as a List.
For example:
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.
Parameters: column - The column to run the comparison on Parameters: values - A List with the disallowed values. A modified Criteria object. |
put | public Object put(Object key, Object value)(Code) | | Overrides Hashtable put, so that this object is returned
instead of the value previously in the Criteria object.
The reason is so that it more closely matches the behavior
of the add() methods. If you want to get the previous value
then you should first Criteria.get() it yourself. Note, if
you attempt to pass in an Object that is not a String, it will
throw a NPE. The reason for this is that none of the add()
methods support adding anything other than a String as a key.
Parameters: key - An Object. Must be instanceof String! Parameters: value - An Object. throws: NullPointerException - if key != String or key/value is null. Instance of self. |
putAll | public synchronized void putAll(Map t)(Code) | | 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.
if the map was another Criteria, its attributes are copied to this
Criteria, overwriting previous settings.
Parameters: t - Mappings to be stored in this map. |
remove | public Object remove(String key)(Code) | | Remove an object from the criteria.
Parameters: key - A String with the key to be removed. The removed object. |
setAll | public void setAll()(Code) | | Adds "ALL " to the SQL statement.
|
setCascade | public Criteria setCascade(boolean b)(Code) | | Set cascade.
Parameters: b - True if cascade is set. A modified Criteria object. |
setDbName | public void setDbName(String dbName)(Code) | | Set the DatabaseMap name. If null is supplied, uses value
provided by Torque.getDefaultDB() .
Parameters: dbName - A String with the Database(Map) name. |
setDistinct | public void setDistinct()(Code) | | Adds "DISTINCT " to the SQL statement.
|
setIgnoreCase | public Criteria setIgnoreCase(boolean b)(Code) | | Sets ignore case.
Parameters: b - True if case should be ignored. A modified Criteria object. |
setLimit | public Criteria setLimit(int limit)(Code) | | Set limit.
Parameters: limit - An int with the value for limit. A modified Criteria object. |
setOffset | public Criteria setOffset(int offset)(Code) | | Set offset.
Parameters: offset - An int with the value for offset. A modified Criteria object. |
setSingleRecord | public Criteria setSingleRecord(boolean b)(Code) | | 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). 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).
Parameters: b - set to true if you expect the query to select justone record. A modified Criteria object. |
setUseTransaction | public void setUseTransaction(boolean v)(Code) | | Will force the sql represented by this criteria to be executed within
a transaction. This is here primarily to support the oid type in
postgresql. Though it can be used to require any single sql statement
to use a transaction.
|
toString | public String toString()(Code) | | Build a string representation of the Criteria.
A String with the representation of the Criteria. |
|
|