org.apache.turbine.util.db
Class Criteria

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--org.apache.turbine.util.db.Criteria
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class Criteria
extends java.util.Hashtable

This is a utility class that is used for retrieving different types of values from a hashtable based on a simple name string. This class is meant to minimize the amount of casting that needs to be done when working with Hashtables. NOTE: other methods will be added as needed and as time permits.

Version:
$Id$
Author:
Frank Y. Kim, John D. McNally, Brett McLaughlin, Eric Dobbs, Henning P. Schmiedehausen
See Also:
Serialized Form

Inner Class Summary
 class Criteria.Criterion
          This is an inner class that describes an object in the criteria.
 
Inner classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
private  java.util.HashMap aliases
           
static java.lang.String ALL
          Comparison type.
static java.lang.String ALT_NOT_EQUAL
          Comparison type.
private static java.lang.String ASC
          "Order by" qualifier - ascending
private  java.util.Hashtable asColumns
           
private  boolean cascade
           
static java.lang.String CUSTOM
          Comparison type.
private  java.lang.String dbName
          The name of the database.
private static int DEFAULT_CAPACITY
           
private static java.lang.String DESC
          "Order by" qualifier - descending
static java.lang.String DISTINCT
          Comparison type.
static java.lang.String EQUAL
          Comparison type.
static java.lang.String GREATER_EQUAL
          Comparison type.
static java.lang.String GREATER_THAN
          Comparison type.
private  boolean ignoreCase
           
static java.lang.String IN
          Comparison type.
static java.lang.String JOIN
          Comparison type.
private  java.util.ArrayList joinL
           
private  java.util.ArrayList joinR
           
static java.lang.String LESS_EQUAL
          Comparison type.
static java.lang.String LESS_THAN
          Comparison type.
static java.lang.String LIKE
          Comparison type.
private  int limit
          To limit the number of rows to return.
static java.lang.String NOT_EQUAL
          Comparison type.
static java.lang.String NOT_IN
          Comparison type.
private  int offset
          To start the results at a row other than the first one.
private  StringStackBuffer orderByColumns
           
private  StringStackBuffer selectColumns
           
private  StringStackBuffer selectModifiers
           
private  boolean singleRecord
           
 
Fields inherited from class java.util.Hashtable
count, emptyEnumerator, emptyIterator, ENTRIES, entrySet, KEYS, keySet, loadFactor, modCount, serialVersionUID, table, threshold, values, VALUES
 
Constructor Summary
Criteria()
          Creates a new instance with the default capacity.
Criteria(int initialCapacity)
          Creates a new instance with the specified capacity.
Criteria(java.lang.String dbName)
          Creates a new instance with the default capacity which corresponds to the specified database.
Criteria(java.lang.String dbName, int initialCapacity)
          Creates a new instance with the specified capacity which corresponds to the specified database.
 
Method Summary
 Criteria add(Criteria.Criterion c)
          This method adds a prepared Criterion object to the Criteria.
 Criteria add(java.lang.String column, boolean value)
          Convenience method to add a boolean to Criteria.
 Criteria add(java.lang.String column, boolean value, java.lang.String comparison)
          Convenience method to add a boolean to Criteria.
 Criteria add(java.lang.String column, double value)
          Convenience method to add a double to Criteria.
 Criteria add(java.lang.String column, double value, java.lang.String comparison)
          Convenience method to add a double to Criteria Equal to
 Criteria add(java.lang.String column, float value)
          Convenience method to add a float to Criteria.
 Criteria add(java.lang.String column, float value, java.lang.String comparison)
          Convenience method to add a float to Criteria Equal to
 Criteria add(java.lang.String column, int value)
          Convenience method to add an int to Criteria.
 Criteria add(java.lang.String column, int value, java.lang.String comparison)
          Convenience method to add an int to Criteria.
 Criteria add(java.lang.String column, long value)
          Convenience method to add a long to Criteria.
 Criteria add(java.lang.String column, long value, java.lang.String comparison)
          Convenience method to add a long to Criteria Equal to
 Criteria add(java.lang.String key, java.lang.Object value)
          This method adds a new criterion to the list of criterias.
 Criteria add(java.lang.String column, java.lang.Object value, java.lang.String comparison)
          This method adds a new criterion to the list of criterias.
 Criteria add(java.lang.String table, java.lang.String column, java.lang.Object value)
          This method adds a new criterion to the list of criterias.
 Criteria add(java.lang.String table, java.lang.String column, java.lang.Object value, java.lang.String comparison)
          This method adds a new criterion to the list of criterias.
 void addAlias(java.lang.String alias, java.lang.String table)
          Allows one to specify an alias for a table that can be used in various parts of the SQL.
 Criteria addAscendingOrderByColumn(java.lang.String name)
          Add order by column name, explicitly specifying ascending.
 Criteria addAsColumn(java.lang.String name, java.lang.String clause)
          Add an AS clause to the select columns.
 Criteria addDate(java.lang.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
 Criteria addDate(java.lang.String column, int year, int month, int date, java.lang.String comparison)
          Convenience method to add a Date object specified by year, month, and date into the Criteria Equal to
 Criteria addDescendingOrderByColumn(java.lang.String name)
          Add order by column name, explicitly specifying descending.
 Criteria addIn(java.lang.String column, int[] values)
          Adds an 'IN' clause with the criteria supplied as an int array.
 Criteria addIn(java.lang.String column, java.util.List values)
          Adds an 'IN' clause with the criteria supplied as a Vector.
 Criteria addIn(java.lang.String column, java.lang.Object[] values)
          Adds an 'IN' clause with the criteria supplied as an Object array.
 Criteria addJoin(java.lang.String left, java.lang.String right)
          This is the way that you should add a join of two tables.
 Criteria addNotIn(java.lang.String column, int[] values)
          Adds a 'NOT IN' clause with the criteria supplied as an int array.
 Criteria addNotIn(java.lang.String column, java.util.List values)
          Adds a 'NOT IN' clause with the criteria supplied as a Vector.
 Criteria addNotIn(java.lang.String column, java.lang.Object[] values)
          Adds a 'NOT IN' clause with the criteria supplied as an Object array.
 Criteria addOrderByColumn(java.lang.String name)
          Deprecated. Use addAscendingOrderByColumn() instead.
 Criteria addSelectColumn(java.lang.String name)
          Add select column.
 Criteria addTime(java.lang.String column, int year, int month, int date)
          Deprecated. These methods were wrongly named and are misleading. Use addDate() instead.
 Criteria addTime(java.lang.String column, int year, int month, int date, java.lang.String comparison)
          Deprecated. These methods were wrongly named and are misleading. Use addDate() instead.
 Criteria and(Criteria.Criterion c)
          This method adds a prepared Criterion object to the Criteria.
 Criteria and(java.lang.String column, boolean value)
          Convenience method to add a boolean to Criteria.
 Criteria and(java.lang.String column, boolean value, java.lang.String comparison)
          Convenience method to add a boolean to Criteria.
 Criteria and(java.lang.String column, double value)
          Convenience method to add a double to Criteria.
 Criteria and(java.lang.String column, double value, java.lang.String comparison)
          Convenience method to add a double to Criteria Equal to
 Criteria and(java.lang.String column, float value)
          Convenience method to add a float to Criteria.
 Criteria and(java.lang.String column, float value, java.lang.String comparison)
          Convenience method to add a float to Criteria Equal to
 Criteria and(java.lang.String column, int value)
          Convenience method to add an int to Criteria.
 Criteria and(java.lang.String column, int value, java.lang.String comparison)
          Convenience method to add an int to Criteria.
 Criteria and(java.lang.String column, long value)
          Convenience method to add a long to Criteria.
 Criteria and(java.lang.String column, long value, java.lang.String comparison)
          Convenience method to add a long to Criteria Equal to
 Criteria and(java.lang.String column, java.lang.Object value)
          This method adds a new criterion to the list of criterias.
 Criteria and(java.lang.String column, java.lang.Object value, java.lang.String comparison)
          This method adds a new criterion to the list of criterias.
 Criteria and(java.lang.String table, java.lang.String column, java.lang.Object value)
          This method adds a new criterion to the list of criterias.
 Criteria and(java.lang.String table, java.lang.String column, java.lang.Object value, java.lang.String comparison)
          This method adds a new criterion to the list of criterias.
 Criteria andDate(java.lang.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
 Criteria andDate(java.lang.String column, int year, int month, int date, java.lang.String comparison)
          Convenience method to add a Date object specified by year, month, and date into the Criteria Equal to
 Criteria andIn(java.lang.String column, int[] values)
          Adds an 'IN' clause with the criteria supplied as an int array.
 Criteria andIn(java.lang.String column, java.lang.Object[] values)
          Adds an 'IN' clause with the criteria supplied as an Object array.
 Criteria andIn(java.lang.String column, java.util.Vector values)
          Adds an 'IN' clause with the criteria supplied as a Vector.
 Criteria andNotIn(java.lang.String column, int[] values)
          Adds a 'NOT IN' clause with the criteria supplied as an int array.
 Criteria andNotIn(java.lang.String column, java.lang.Object[] values)
          Adds a 'NOT IN' clause with the criteria supplied as an Object array.
 Criteria andNotIn(java.lang.String column, java.util.Vector values)
          Adds a 'NOT IN' clause with the criteria supplied as a Vector.
 boolean containsKey(java.lang.String table, java.lang.String column)
          Does this Criteria Object contain the specified key?
 boolean containsObjectColumn()
          Returns true if any of the tables in the criteria contain an Object column.
 boolean containsObjectColumn(java.lang.String databaseMapName)
          Returns true if any of the tables in the criteria contain an Object column.
 boolean equals(java.lang.Object crit)
          This method checks another Criteria to see if they contain the same attributes and hashtable entries.
 java.lang.Object get(java.lang.Object key)
          Overrides Hashtable get, so that the value placed in the Criterion is returned instead of the Criterion.
 java.util.Hashtable getAsColumns()
          Get the column aliases.
 java.math.BigDecimal getBigDecimal(java.lang.String name)
          Convenience method to return a BigDecimal.
 java.math.BigDecimal getBigDecimal(java.lang.String table, java.lang.String column)
          Convenience method to return a BigDecimal.
 boolean getBoolean(java.lang.String column)
          Convenience method to return value as a boolean.
 boolean getBoolean(java.lang.String table, java.lang.String column)
          Convenience method to return value as a boolean.
 java.lang.String getColumnName(java.lang.String name)
          Method to return a String table name.
 java.lang.String getComparison(java.lang.String key)
          Method to return a comparison String.
 java.lang.String getComparison(java.lang.String table, java.lang.String column)
          Method to return a comparison String.
 Criteria.Criterion getCriterion(java.lang.String column)
          Method to return criteria related to columns in a table.
 Criteria.Criterion getCriterion(java.lang.String table, java.lang.String column)
          Method to return criteria related to a column in a table.
 java.util.Date getDate(java.lang.String name)
          Convenience method to return a Date.
 java.util.Date getDate(java.lang.String table, java.lang.String column)
          Convenience method to return a Date.
 java.lang.String getDbName()
          Get the Database(Map) name.
 double getDouble(java.lang.String name)
          Convenience method to return a double.
 double getDouble(java.lang.String table, java.lang.String column)
          Convenience method to return a double.
 float getFloat(java.lang.String name)
          Convenience method to return a float.
 float getFloat(java.lang.String table, java.lang.String column)
          Convenience method to return a float.
 int getInt(java.lang.String name)
          Convenience method to return an int.
 int getInt(java.lang.String table, java.lang.String column)
          Convenience method to return an int.
 java.lang.Integer getInteger(java.lang.String name)
          Convenience method to return an Integer.
 java.lang.Integer getInteger(java.lang.String table, java.lang.String column)
          Convenience method to return an Integer.
 java.util.List getJoinL()
          get one side of the set of possible joins.
 java.util.List getJoinR()
          get one side of the set of possible joins.
 int getLimit()
          Get limit.
 long getLong(java.lang.String name)
          Convenience method to return a long.
 long getLong(java.lang.String table, java.lang.String column)
          Convenience method to return a long.
 Criteria.Criterion getNewCriterion(java.lang.String column, java.lang.Object value, java.lang.String comparison)
          Method to return criterion that is not added automatically to this Criteria.
 Criteria.Criterion getNewCriterion(java.lang.String table, java.lang.String column, java.lang.Object value, java.lang.String comparison)
          Method to return criterion that is not added automatically to this Criteria.
 ObjectKey getObjectKey(java.lang.String name)
          Convenience method to return an ObjectKey.
 ObjectKey getObjectKey(java.lang.String table, java.lang.String column)
          Convenience method to return an ObjectKey.
 int getOffset()
          Get offset.
 StringStackBuffer getOrderByColumns()
          Get order by columns.
 StringStackBuffer getSelectColumns()
          Get select columns.
 StringStackBuffer getSelectModifiers()
          Get select modifiers.
 java.lang.String getString(java.lang.String name)
          Convenience method to return a String.
 java.lang.String getString(java.lang.String table, java.lang.String column)
          Convenience method to return a String.
 java.lang.String getTableForAlias(java.lang.String alias)
          Returns the table name associated with an alias.
 java.lang.String getTableName(java.lang.String name)
          Method to return a String table name.
 java.lang.Object getValue(java.lang.String name)
          Method to return the value that was added to Criteria.
 java.lang.Object getValue(java.lang.String table, java.lang.String column)
          Method to return the value that was added to Criteria.
 java.util.Vector getVector(java.lang.String name)
          Convenience method to return a Vector.
 java.util.Vector getVector(java.lang.String table, java.lang.String column)
          Convenience method to return a String.
 boolean isCascade()
          Is cascade set?
 boolean isIgnoreCase()
          Is ignore case on or off?
 boolean isSingleRecord()
          Is single record?
 Criteria or(Criteria.Criterion c)
          This method adds a prepared Criterion object to the Criteria.
 Criteria or(java.lang.String column, boolean value)
          Convenience method to add a boolean to Criteria.
 Criteria or(java.lang.String column, boolean value, java.lang.String comparison)
          Convenience method to add a boolean to Criteria.
 Criteria or(java.lang.String column, double value)
          Convenience method to add a double to Criteria.
 Criteria or(java.lang.String column, double value, java.lang.String comparison)
          Convenience method to add a double to Criteria Equal to
 Criteria or(java.lang.String column, float value)
          Convenience method to add a float to Criteria.
 Criteria or(java.lang.String column, float value, java.lang.String comparison)
          Convenience method to add a float to Criteria Equal to
 Criteria or(java.lang.String column, int value)
          Convenience method to add an int to Criteria.
 Criteria or(java.lang.String column, int value, java.lang.String comparison)
          Convenience method to add an int to Criteria.
 Criteria or(java.lang.String column, long value)
          Convenience method to add a long to Criteria.
 Criteria or(java.lang.String column, long value, java.lang.String comparison)
          Convenience method to add a long to Criteria Equal to
 Criteria or(java.lang.String column, java.lang.Object value)
          This method adds a new criterion to the list of criterias.
 Criteria or(java.lang.String column, java.lang.Object value, java.lang.String comparison)
          This method adds a new criterion to the list of criterias.
 Criteria or(java.lang.String table, java.lang.String column, java.lang.Object value)
          This method adds a new criterion to the list of criterias.
 Criteria or(java.lang.String table, java.lang.String column, java.lang.Object value, java.lang.String comparison)
          This method adds a new criterion to the list of criterias.
 Criteria orDate(java.lang.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
 Criteria orDate(java.lang.String column, int year, int month, int date, java.lang.String comparison)
          Convenience method to add a Date object specified by year, month, and date into the Criteria Equal to
 Criteria orIn(java.lang.String column, int[] values)
          Adds an 'IN' clause with the criteria supplied as an int array.
 Criteria orIn(java.lang.String column, java.lang.Object[] values)
          Adds an 'IN' clause with the criteria supplied as an Object array.
 Criteria orIn(java.lang.String column, java.util.Vector values)
          Adds an 'IN' clause with the criteria supplied as a Vector.
 Criteria orNotIn(java.lang.String column, int[] values)
          Adds a 'NOT IN' clause with the criteria supplied as an int array.
 Criteria orNotIn(java.lang.String column, java.lang.Object[] values)
          Adds a 'NOT IN' clause with the criteria supplied as an Object array.
 Criteria orNotIn(java.lang.String column, java.util.Vector values)
          Adds a 'NOT IN' clause with the criteria supplied as a Vector.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Overrides Hashtable put, so that this object is returned instead of the value previously in the Criteria object.
 void putAll(java.util.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.
 java.lang.Object remove(java.lang.String key)
          Remove an object from the criteria.
 void setAll()
          Adds "ALL " to the SQL statement.
 Criteria setCascade(boolean b)
          Set cascade.
 void setDbName(java.lang.String dbName)
          Set the DatabaseMap name.
 void setDistinct()
          Adds "DISTINCT " to the SQL statement.
 Criteria setIgnoreCase(boolean b)
          Sets ignore case.
 Criteria setLimit(int limit)
          Set limit.
 Criteria setOffset(int offset)
          Set offset.
 Criteria setSingleRecord(boolean b)
          Set single record?
 java.lang.String toString()
          Build a string representation of the Criteria.
 
Methods inherited from class java.util.Hashtable
, clear, clone, contains, containsKey, containsValue, elements, entrySet, getEnumeration, getIterator, hashCode, isEmpty, keys, keySet, readObject, rehash, remove, size, values, writeObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

EQUAL

public static final java.lang.String EQUAL
Comparison type.

NOT_EQUAL

public static final java.lang.String NOT_EQUAL
Comparison type.

ALT_NOT_EQUAL

public static final java.lang.String ALT_NOT_EQUAL
Comparison type.

GREATER_THAN

public static final java.lang.String GREATER_THAN
Comparison type.

LESS_THAN

public static final java.lang.String LESS_THAN
Comparison type.

GREATER_EQUAL

public static final java.lang.String GREATER_EQUAL
Comparison type.

LESS_EQUAL

public static final java.lang.String LESS_EQUAL
Comparison type.

LIKE

public static final java.lang.String LIKE
Comparison type.

CUSTOM

public static final java.lang.String CUSTOM
Comparison type.

DISTINCT

public static final java.lang.String DISTINCT
Comparison type.

IN

public static final java.lang.String IN
Comparison type.

NOT_IN

public static final java.lang.String NOT_IN
Comparison type.

ALL

public static final java.lang.String ALL
Comparison type.

JOIN

public static final java.lang.String JOIN
Comparison type.

ASC

private static final java.lang.String ASC
"Order by" qualifier - ascending

DESC

private static final java.lang.String DESC
"Order by" qualifier - descending

DEFAULT_CAPACITY

private static final int DEFAULT_CAPACITY

ignoreCase

private boolean ignoreCase

singleRecord

private boolean singleRecord

cascade

private boolean cascade

selectModifiers

private StringStackBuffer selectModifiers

selectColumns

private StringStackBuffer selectColumns

orderByColumns

private StringStackBuffer orderByColumns

asColumns

private java.util.Hashtable asColumns

joinL

private java.util.ArrayList joinL

joinR

private java.util.ArrayList joinR

dbName

private java.lang.String dbName
The name of the database.

limit

private int limit
To limit the number of rows to return. -1 means return all rows.

offset

private int offset
To start the results at a row other than the first one.

aliases

private java.util.HashMap aliases
Constructor Detail

Criteria

public Criteria()
Creates a new instance with the default capacity.

Criteria

public Criteria(int initialCapacity)
Creates a new instance with the specified capacity.
Parameters:
initialCapacity - An int.

Criteria

public Criteria(java.lang.String dbName)
Creates a new instance with the default capacity which corresponds to the specified database.
Parameters:
dbName - The dabase name.

Criteria

public Criteria(java.lang.String dbName,
                int initialCapacity)
Creates a new instance with the specified capacity which corresponds to the specified database.
Parameters:
dbName - The dabase name.
initialCapacity - The initial capacity.
Method Detail

addAsColumn

public Criteria addAsColumn(java.lang.String name,
                            java.lang.String clause)
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
clause - SQL clause to select from the table If the name already exists, it is replaced by the new clause.
Returns:
A modified Criteria object.

getAsColumns

public java.util.Hashtable getAsColumns()
Get the column aliases.
Returns:
A Hashtable which map the column alias names to the alias clauses.

addAlias

public void addAlias(java.lang.String alias,
                     java.lang.String table)
Allows one to specify an alias for a table that can be used in various parts of the SQL.
Parameters:
alias - a String value
table - a String value

getTableForAlias

public java.lang.String getTableForAlias(java.lang.String alias)
Returns the table name associated with an alias.
Parameters:
alias - a String value
Returns:
a String value

containsKey

public boolean containsKey(java.lang.String table,
                           java.lang.String column)
Does this Criteria Object contain the specified key?
Parameters:
table - The name of the table.
column - The name of the column.
Returns:
True if this Criteria Object contain the specified key.

getBoolean

public boolean getBoolean(java.lang.String column)
Convenience method to return value as a boolean.
Parameters:
column - String name of column.
Returns:
A boolean.

getBoolean

public boolean getBoolean(java.lang.String table,
                          java.lang.String column)
Convenience method to return value as a boolean.
Parameters:
table - String name of table.
column - String name of column.
Returns:
A boolean.

containsObjectColumn

public boolean containsObjectColumn()
                             throws java.lang.Exception
Returns true if any of the tables in the criteria contain an Object column.
Returns:
A boolean.
Throws:
Exception, - a generic exception.

containsObjectColumn

public boolean containsObjectColumn(java.lang.String databaseMapName)
                             throws java.lang.Exception
Returns true if any of the tables in the criteria contain an Object column.
Parameters:
databaseMapName - A String.
Returns:
A boolean.
Throws:
Exception, - a generic exception.

getCriterion

public Criteria.Criterion getCriterion(java.lang.String column)
Method to return criteria related to columns in a table.
Parameters:
column - String name of column.
Returns:
A Criterion.

getCriterion

public Criteria.Criterion getCriterion(java.lang.String table,
                                       java.lang.String column)
Method to return criteria related to a column in a table.
Parameters:
table - String name of table.
column - String name of column.
Returns:
A Criterion.

getNewCriterion

public Criteria.Criterion getNewCriterion(java.lang.String column,
                                          java.lang.Object value,
                                          java.lang.String comparison)
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).
Returns:
A Criterion.

getNewCriterion

public Criteria.Criterion getNewCriterion(java.lang.String table,
                                          java.lang.String column,
                                          java.lang.Object value,
                                          java.lang.String comparison)
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.
column - String name of column.
Returns:
A Criterion.

add

public Criteria add(Criteria.Criterion c)
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
Returns:
A modified Criteria object.

getColumnName

public java.lang.String getColumnName(java.lang.String name)
Method to return a String table name.
Parameters:
name - A String with the name of the key.
Returns:
A String with the value of the object at key.

getComparison

public java.lang.String getComparison(java.lang.String key)
Method to return a comparison String.
Parameters:
key - String name of the key.
Returns:
A String with the value of the object at key.

getComparison

public java.lang.String getComparison(java.lang.String table,
                                      java.lang.String column)
Method to return a comparison String.
Parameters:
table - String name of table.
column - String name of column.
Returns:
A String with the value of the object at key.

getDate

public java.util.Date getDate(java.lang.String name)
Convenience method to return a Date.
Parameters:
table - String name.
Returns:
A java.util.Date with the value of object at key.

getDate

public java.util.Date getDate(java.lang.String table,
                              java.lang.String column)
Convenience method to return a Date.
Parameters:
table - String name of table.
column - String name of column.
Returns:
A java.util.Date with the value of object at key.

getDbName

public java.lang.String getDbName()
Get the Database(Map) name.
Returns:
A String with the Database(Map) name. By default, this is PoolBrokerService.DEFAULT.

setDbName

public void setDbName(java.lang.String dbName)
Set the DatabaseMap name. If null is supplied, uses value provided by TurbineDB.getDefaultDB().
Parameters:
map - A String with the Database(Map) name.

getDouble

public double getDouble(java.lang.String name)
Convenience method to return a double.
Parameters:
name - A String with the name of the key.
Returns:
A double with the value of object at key.

getDouble

public double getDouble(java.lang.String table,
                        java.lang.String column)
Convenience method to return a double.
Parameters:
table - String name of table.
column - String name of column.
Returns:
A double with the value of object at key.

getFloat

public float getFloat(java.lang.String name)
Convenience method to return a float.
Parameters:
name - A String with the name of the key.
Returns:
A float with the value of object at key.

getFloat

public float getFloat(java.lang.String table,
                      java.lang.String column)
Convenience method to return a float.
Parameters:
table - String name of table.
column - String name of column.
Returns:
A float with the value of object at key.

getInteger

public java.lang.Integer getInteger(java.lang.String name)
Convenience method to return an Integer.
Parameters:
name - A String with the name of the key.
Returns:
An Integer with the value of object at key.

getInteger

public java.lang.Integer getInteger(java.lang.String table,
                                    java.lang.String column)
Convenience method to return an Integer.
Parameters:
table - String name of table.
column - String name of column.
Returns:
An Integer with the value of object at key.

getInt

public int getInt(java.lang.String name)
Convenience method to return an int.
Parameters:
name - A String with the name of the key.
Returns:
An int with the value of object at key.

getInt

public int getInt(java.lang.String table,
                  java.lang.String column)
Convenience method to return an int.
Parameters:
table - String name of table.
column - String name of column.
Returns:
An int with the value of object at key.

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.lang.String name)
Convenience method to return a BigDecimal.
Parameters:
name - A String with the name of the key.
Returns:
A BigDecimal with the value of object at key.

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.lang.String table,
                                          java.lang.String column)
Convenience method to return a BigDecimal.
Parameters:
table - String name of table.
column - String name of column.
Returns:
A BigDecimal with the value of object at key.

getLong

public long getLong(java.lang.String name)
Convenience method to return a long.
Parameters:
name - A String with the name of the key.
Returns:
A long with the value of object at key.

getLong

public long getLong(java.lang.String table,
                    java.lang.String column)
Convenience method to return a long.
Parameters:
table - String name of table.
column - String name of column.
Returns:
A long with the value of object at key.

getString

public java.lang.String getString(java.lang.String name)
Convenience method to return a String.
Parameters:
name - A String with the name of the key.
Returns:
A String with the value of object at key.

getString

public java.lang.String getString(java.lang.String table,
                                  java.lang.String column)
Convenience method to return a String.
Parameters:
table - String name of table.
column - String name of column.
Returns:
A String with the value of object at key.

getTableName

public java.lang.String getTableName(java.lang.String name)
Method to return a String table name.
Parameters:
name - A String with the name of the key.
Returns:
A String with the value of object at key.

getVector

public java.util.Vector getVector(java.lang.String name)
Convenience method to return a Vector.
Parameters:
name - A String with the name of the key.
Returns:
A Vector with the value of object at key.

getVector

public java.util.Vector getVector(java.lang.String table,
                                  java.lang.String column)
Convenience method to return a String.
Parameters:
table - String name of table.
column - String name of column.
Returns:
A String with the value of object at key.

getValue

public java.lang.Object getValue(java.lang.String name)
Method to return the value that was added to Criteria.
Parameters:
name - A String with the name of the key.
Returns:
An Object with the value of object at key.

getValue

public java.lang.Object getValue(java.lang.String table,
                                 java.lang.String column)
Method to return the value that was added to Criteria.
Parameters:
table - String name of table.
column - String name of column.
Returns:
An Object with the value of object at key.

getObjectKey

public ObjectKey getObjectKey(java.lang.String name)
Convenience method to return an ObjectKey.
Parameters:
name - A String with the name of the key.
Returns:
An ObjectKey with the value of object at key.

getObjectKey

public ObjectKey getObjectKey(java.lang.String table,
                              java.lang.String column)
Convenience method to return an ObjectKey.
Parameters:
table - String name of table.
column - String name of column.
Returns:
A String with the value of object at key.

get

public java.lang.Object get(java.lang.Object key)
Overrides Hashtable get, so that the value placed in the Criterion is returned instead of the Criterion.
Overrides:
get in class java.util.Hashtable
Parameters:
key - An Object.
Returns:
An Object.

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.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. 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.
Overrides:
put in class java.util.Hashtable
Parameters:
key - An Object. Must be instanceof String!
value - An Object.
Returns:
Instance of self.
Throws:
java.lang.NullPointerException - if key != String or key/value is null.

putAll

public void putAll(java.util.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. if the map was another Criteria, its attributes are copied to this Criteria, overwriting previous settings.
Overrides:
putAll in class java.util.Hashtable
Parameters:
t - Mappings to be stored in this map.

add

public Criteria add(java.lang.String key,
                    java.lang.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. 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
value - An Object.
Returns:
A modified Criteria object.

add

public Criteria add(java.lang.String column,
                    java.lang.Object value,
                    java.lang.String comparison)
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" "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 add(table, column, value) method.

Parameters:
column - The column to run the comparison on
value - An Object.
comparison - A String.
Returns:
A modified Criteria object.

add

public Criteria add(java.lang.String table,
                    java.lang.String column,
                    java.lang.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. 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
column - The column to run the comparison on
value - An Object.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

add

public Criteria add(java.lang.String table,
                    java.lang.String column,
                    java.lang.Object value,
                    java.lang.String comparison)
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", "Criterion.GREATER_THAN"); Any comparison can be used.

Parameters:
table - Name of table which contains the column
column - The column to run the comparison on
value - An Object.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

add

public Criteria add(java.lang.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
value - A Boolean.
Returns:
A modified Criteria object.

add

public Criteria add(java.lang.String column,
                    boolean value,
                    java.lang.String comparison)
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
value - A Boolean.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

add

public Criteria add(java.lang.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
value - An int.
Returns:
A modified Criteria object.

add

public Criteria add(java.lang.String column,
                    int value,
                    java.lang.String comparison)
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
value - An int.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

add

public Criteria add(java.lang.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
value - A long.
Returns:
A modified Criteria object.

add

public Criteria add(java.lang.String column,
                    long value,
                    java.lang.String comparison)
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
value - A long.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

add

public Criteria add(java.lang.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
value - A float.
Returns:
A modified Criteria object.

add

public Criteria add(java.lang.String column,
                    float value,
                    java.lang.String comparison)
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
value - A float.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

add

public Criteria add(java.lang.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
value - A double.
Returns:
A modified Criteria object.

add

public Criteria add(java.lang.String column,
                    double value,
                    java.lang.String comparison)
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
value - A double.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

addTime

public Criteria addTime(java.lang.String column,
                        int year,
                        int month,
                        int date)
Deprecated. These methods were wrongly named and are misleading. Use addDate() instead.


addTime

public Criteria addTime(java.lang.String column,
                        int year,
                        int month,
                        int date,
                        java.lang.String comparison)
Deprecated. These methods were wrongly named and are misleading. Use addDate() instead.


addDate

public Criteria addDate(java.lang.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.
year - An int with the year.
month - An int with the month.
date - An int with the date.
Returns:
A modified Criteria object.

addDate

public Criteria addDate(java.lang.String column,
                        int year,
                        int month,
                        int date,
                        java.lang.String 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
year - 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
Returns:
A modified Criteria object.

addJoin

public Criteria addJoin(java.lang.String left,
                        java.lang.String right)
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.
right - A String with the right side of the join.
Returns:
A modified Criteria object.

getJoinL

public java.util.List getJoinL()
get one side of the set of possible joins. This method is meant to be called by BasePeer.

getJoinR

public java.util.List getJoinR()
get one side of the set of possible joins. This method is meant to be called by BasePeer.

addIn

public Criteria addIn(java.lang.String column,
                      java.lang.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 replaced.

Parameters:
column - The column to run the comparison on
values - An Object[] with the allowed values.
Returns:
A modified Criteria object.

addIn

public Criteria addIn(java.lang.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
values - An int[] with the allowed values.
Returns:
A modified Criteria object.

addIn

public Criteria addIn(java.lang.String column,
                      java.util.List values)
Adds an 'IN' clause with the criteria supplied as a Vector. 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
values - A List with the allowed values.
Returns:
A modified Criteria object.

addNotIn

public Criteria addNotIn(java.lang.String column,
                         java.lang.Object[] values)
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
values - An Object[] with the disallowed values.
Returns:
A modified Criteria object.

addNotIn

public Criteria addNotIn(java.lang.String column,
                         int[] values)
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
values - An int[] with the disallowed values.
Returns:
A modified Criteria object.

addNotIn

public Criteria addNotIn(java.lang.String column,
                         java.util.List values)
Adds a 'NOT IN' clause with the criteria supplied as a Vector. 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
values - A List with the disallowed values.
Returns:
A modified Criteria object.

setAll

public void setAll()
Adds "ALL " to the SQL statement.

setDistinct

public void setDistinct()
Adds "DISTINCT " to the SQL statement.

setIgnoreCase

public Criteria setIgnoreCase(boolean b)
Sets ignore case.
Parameters:
b - True if case should be ignored.
Returns:
A modified Criteria object.

isIgnoreCase

public boolean isIgnoreCase()
Is ignore case on or off?
Returns:
True if case is ignored.

setSingleRecord

public Criteria setSingleRecord(boolean b)
Set single record?
Parameters:
b - True if a single record should be returned.
Returns:
A modified Criteria object.

isSingleRecord

public boolean isSingleRecord()
Is single record?
Returns:
True if a single record is being returned.

setCascade

public Criteria setCascade(boolean b)
Set cascade.
Parameters:
b - True if cascade is set.
Returns:
A modified Criteria object.

isCascade

public boolean isCascade()
Is cascade set?
Returns:
True if cascade is set.

setLimit

public Criteria setLimit(int limit)
Set limit.
Parameters:
limit - An int with the value for limit.
Returns:
A modified Criteria object.

getLimit

public int getLimit()
Get limit.
Returns:
An int with the value for limit.

setOffset

public Criteria setOffset(int offset)
Set offset.
Parameters:
offset - An int with the value for offset.
Returns:
A modified Criteria object.

getOffset

public int getOffset()
Get offset.
Returns:
An int with the value for offset.

addSelectColumn

public Criteria addSelectColumn(java.lang.String name)
Add select column.
Parameters:
name - A String with the name of the select column.
Returns:
A modified Criteria object.

getSelectColumns

public StringStackBuffer getSelectColumns()
Get select columns.
Returns:
A StringStackBuffer with the name of the select columns.

getSelectModifiers

public StringStackBuffer getSelectModifiers()
Get select modifiers.
Returns:
A StringStackBuffer with the select modifiers.

addOrderByColumn

public Criteria addOrderByColumn(java.lang.String name)
Deprecated. Use addAscendingOrderByColumn() instead.


addAscendingOrderByColumn

public Criteria addAscendingOrderByColumn(java.lang.String name)
Add order by column name, explicitly specifying ascending.
Parameters:
name - The name of the column to order by.
Returns:
A modified Criteria object.

addDescendingOrderByColumn

public Criteria addDescendingOrderByColumn(java.lang.String name)
Add order by column name, explicitly specifying descending.
Parameters:
name - The name of the column to order by.
Returns:
A modified Criteria object.

getOrderByColumns

public StringStackBuffer getOrderByColumns()
Get order by columns.
Returns:
A StringStackBuffer with the name of the order columns.

remove

public java.lang.Object remove(java.lang.String key)
Remove an object from the criteria.
Parameters:
key - A String with the key to be removed.
Returns:
The removed object.

toString

public java.lang.String toString()
Build a string representation of the Criteria.
Overrides:
toString in class java.util.Hashtable
Returns:
A String with the representation of the Criteria.

equals

public boolean equals(java.lang.Object crit)
This method checks another Criteria to see if they contain the same attributes and hashtable entries.
Overrides:
equals in class java.util.Hashtable

and

public Criteria and(Criteria.Criterion c)
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
Returns:
A modified Criteria object.

and

public Criteria and(java.lang.String column,
                    java.lang.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. 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
value - An Object.
Returns:
A modified Criteria object.

and

public Criteria and(java.lang.String column,
                    java.lang.Object value,
                    java.lang.String 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. If is used as follow:

Criteria crit = new Criteria().and("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 and(table, column, value) method.

Parameters:
column - The column to run the comparison on
value - An Object.
comparison - A String.
Returns:
A modified Criteria object.

and

public Criteria and(java.lang.String table,
                    java.lang.String column,
                    java.lang.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. 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
column - The column to run the comparison on
value - An Object.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

and

public Criteria and(java.lang.String table,
                    java.lang.String column,
                    java.lang.Object value,
                    java.lang.String 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. 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
column - The column to run the comparison on
value - An Object.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

and

public Criteria and(java.lang.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
value - A Boolean.
Returns:
A modified Criteria object.

and

public Criteria and(java.lang.String column,
                    boolean value,
                    java.lang.String comparison)
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
value - A Boolean.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

and

public Criteria and(java.lang.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
value - An int.
Returns:
A modified Criteria object.

and

public Criteria and(java.lang.String column,
                    int value,
                    java.lang.String comparison)
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
value - An int.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

and

public Criteria and(java.lang.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
value - A long.
Returns:
A modified Criteria object.

and

public Criteria and(java.lang.String column,
                    long value,
                    java.lang.String comparison)
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
value - A long.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

and

public Criteria and(java.lang.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
value - A float.
Returns:
A modified Criteria object.

and

public Criteria and(java.lang.String column,
                    float value,
                    java.lang.String comparison)
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
value - A float.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

and

public Criteria and(java.lang.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
value - A double.
Returns:
A modified Criteria object.

and

public Criteria and(java.lang.String column,
                    double value,
                    java.lang.String comparison)
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
value - A double.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

andDate

public Criteria andDate(java.lang.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.
year - An int with the year.
month - An int with the month.
date - An int with the date.
Returns:
A modified Criteria object.

andDate

public Criteria andDate(java.lang.String column,
                        int year,
                        int month,
                        int date,
                        java.lang.String comparison)
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
year - 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
Returns:
A modified Criteria object.

andIn

public Criteria andIn(java.lang.String column,
                      java.lang.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
values - An Object[] with the allowed values.
Returns:
A modified Criteria object.

andIn

public Criteria andIn(java.lang.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
values - An int[] with the allowed values.
Returns:
A modified Criteria object.

andIn

public Criteria andIn(java.lang.String column,
                      java.util.Vector values)
Adds an 'IN' clause with the criteria supplied as a Vector. 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
values - A Vector with the allowed values.
Returns:
A modified Criteria object.

andNotIn

public Criteria andNotIn(java.lang.String column,
                         java.lang.Object[] values)
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
values - An Object[] with the disallowed values.
Returns:
A modified Criteria object.

andNotIn

public Criteria andNotIn(java.lang.String column,
                         int[] values)
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
values - An int[] with the disallowed values.
Returns:
A modified Criteria object.

andNotIn

public Criteria andNotIn(java.lang.String column,
                         java.util.Vector values)
Adds a 'NOT IN' clause with the criteria supplied as a Vector. 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
values - A Vector with the disallowed values.
Returns:
A modified Criteria object.

or

public Criteria or(Criteria.Criterion c)
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
Returns:
A modified Criteria object.

or

public Criteria or(java.lang.String column,
                   java.lang.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. 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
value - An Object.
Returns:
A modified Criteria object.

or

public Criteria or(java.lang.String column,
                   java.lang.Object value,
                   java.lang.String 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. 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
value - An Object.
comparison - A String.
Returns:
A modified Criteria object.

or

public Criteria or(java.lang.String table,
                   java.lang.String column,
                   java.lang.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. 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
column - The column to run the comparison on
value - An Object.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

or

public Criteria or(java.lang.String table,
                   java.lang.String column,
                   java.lang.Object value,
                   java.lang.String 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. 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
column - The column to run the comparison on
value - An Object.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

or

public Criteria or(java.lang.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
value - A Boolean.
Returns:
A modified Criteria object.

or

public Criteria or(java.lang.String column,
                   boolean value,
                   java.lang.String comparison)
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
value - A Boolean.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

or

public Criteria or(java.lang.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
value - An int.
Returns:
A modified Criteria object.

or

public Criteria or(java.lang.String column,
                   int value,
                   java.lang.String comparison)
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
value - An int.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

or

public Criteria or(java.lang.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
value - A long.
Returns:
A modified Criteria object.

or

public Criteria or(java.lang.String column,
                   long value,
                   java.lang.String comparison)
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
value - A long.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

or

public Criteria or(java.lang.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
value - A float.
Returns:
A modified Criteria object.

or

public Criteria or(java.lang.String column,
                   float value,
                   java.lang.String comparison)
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
value - A float.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

or

public Criteria or(java.lang.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
value - A double.
Returns:
A modified Criteria object.

or

public Criteria or(java.lang.String column,
                   double value,
                   java.lang.String comparison)
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
value - A double.
comparison - String describing how to compare the column with the value
Returns:
A modified Criteria object.

orDate

public Criteria orDate(java.lang.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.
year - An int with the year.
month - An int with the month.
date - An int with the date.
Returns:
A modified Criteria object.

orDate

public Criteria orDate(java.lang.String column,
                       int year,
                       int month,
                       int date,
                       java.lang.String comparison)
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
year - 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
Returns:
A modified Criteria object.

orIn

public Criteria orIn(java.lang.String column,
                     java.lang.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 "OR"ed to the existing criterion.

Parameters:
column - The column to run the comparison on
values - An Object[] with the allowed values.
Returns:
A modified Criteria object.

orIn

public Criteria orIn(java.lang.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
values - An int[] with the allowed values.
Returns:
A modified Criteria object.

orIn

public Criteria orIn(java.lang.String column,
                     java.util.Vector values)
Adds an 'IN' clause with the criteria supplied as a Vector. 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
values - A Vector with the allowed values.
Returns:
A modified Criteria object.

orNotIn

public Criteria orNotIn(java.lang.String column,
                        java.lang.Object[] values)
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
values - An Object[] with the disallowed values.
Returns:
A modified Criteria object.

orNotIn

public Criteria orNotIn(java.lang.String column,
                        int[] values)
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
values - An int[] with the disallowed values.
Returns:
A modified Criteria object.

orNotIn

public Criteria orNotIn(java.lang.String column,
                        java.util.Vector values)
Adds a 'NOT IN' clause with the criteria supplied as a Vector. 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
values - A Vector with the disallowed values.
Returns:
A modified Criteria object.


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.