|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--org.apache.turbine.util.db.Criteria
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.
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 |
blobFlag
|
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 |
ISNOTNULL
"IS NOT NULL" null comparison |
static java.lang.String |
ISNULL
"IS NULL" null comparison |
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. |
void |
setBlobFlag()
Peers can set this flag to notify BasePeer that the table(s) involved in the Criteria contain Blobs, so that the operation can be placed in a transaction if the db requires it. |
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 |
|
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait |
Field Detail |
public static final java.lang.String EQUAL
public static final java.lang.String NOT_EQUAL
public static final java.lang.String ALT_NOT_EQUAL
public static final java.lang.String GREATER_THAN
public static final java.lang.String LESS_THAN
public static final java.lang.String GREATER_EQUAL
public static final java.lang.String LESS_EQUAL
public static final java.lang.String LIKE
public static final java.lang.String CUSTOM
public static final java.lang.String DISTINCT
public static final java.lang.String IN
public static final java.lang.String NOT_IN
public static final java.lang.String ALL
public static final java.lang.String JOIN
private static final java.lang.String ASC
private static final java.lang.String DESC
public static final java.lang.String ISNULL
public static final java.lang.String ISNOTNULL
private static final int DEFAULT_CAPACITY
private boolean ignoreCase
private boolean singleRecord
private boolean cascade
private StringStackBuffer selectModifiers
private StringStackBuffer selectColumns
private StringStackBuffer orderByColumns
private java.util.Hashtable asColumns
private java.util.ArrayList joinL
private java.util.ArrayList joinR
private java.lang.String dbName
private int limit
-1
means return all
rows.private int offset
private java.util.HashMap aliases
private boolean blobFlag
Constructor Detail |
public Criteria()
public Criteria(int initialCapacity)
initialCapacity
- An int.public Criteria(java.lang.String dbName)
dbName
- The dabase name.public Criteria(java.lang.String dbName, int initialCapacity)
dbName
- The dabase name.initialCapacity
- The initial capacity.Method Detail |
public Criteria addAsColumn(java.lang.String name, java.lang.String clause)
Criteria myCrit = new Criteria();
myCrit.addAsColumn("alias", "ALIAS("+MyPeer.ID+")");
name
- wanted Name of the columnclause
- SQL clause to select from the table
If the name already exists, it is replaced by the new clause.public java.util.Hashtable getAsColumns()
public void addAlias(java.lang.String alias, java.lang.String table)
alias
- a String
valuetable
- a String
valuepublic java.lang.String getTableForAlias(java.lang.String alias)
alias
- a String
valueString
valuepublic boolean containsKey(java.lang.String table, java.lang.String column)
table
- The name of the table.column
- The name of the column.public boolean getBoolean(java.lang.String column)
column
- String name of column.public boolean getBoolean(java.lang.String table, java.lang.String column)
table
- String name of table.column
- String name of column.public boolean containsObjectColumn() throws java.lang.Exception
Exception,
- a generic exception.public boolean containsObjectColumn(java.lang.String databaseMapName) throws java.lang.Exception
databaseMapName
- A String.Exception,
- a generic exception.public Criteria.Criterion getCriterion(java.lang.String column)
column
- String name of column.public Criteria.Criterion getCriterion(java.lang.String table, java.lang.String column)
table
- String name of table.column
- String name of column.public Criteria.Criterion getNewCriterion(java.lang.String column, java.lang.Object value, java.lang.String comparison)
column
- String full name of column (for example TABLE.COLUMN).public Criteria.Criterion getNewCriterion(java.lang.String table, java.lang.String column, java.lang.Object value, java.lang.String comparison)
table
- String name of table.column
- String name of column.public Criteria add(Criteria.Criterion c)
Criteria crit = new Criteria();
Criteria.Criterion c = crit
.getNewCriterion(BasePeer.ID, new Integer(5), Criteria.LESS_THAN);
crit.add(c);
c
- A Criterion objectpublic java.lang.String getColumnName(java.lang.String name)
name
- A String with the name of the key.public java.lang.String getComparison(java.lang.String key)
key
- String name of the key.public java.lang.String getComparison(java.lang.String table, java.lang.String column)
table
- String name of table.column
- String name of column.public java.util.Date getDate(java.lang.String name)
table
- String name.public java.util.Date getDate(java.lang.String table, java.lang.String column)
table
- String name of table.column
- String name of column.public java.lang.String getDbName()
public void setDbName(java.lang.String dbName)
null
is supplied, uses value
provided by TurbineDB.getDefaultDB()
.map
- A String with the Database(Map) name.public double getDouble(java.lang.String name)
name
- A String with the name of the key.public double getDouble(java.lang.String table, java.lang.String column)
table
- String name of table.column
- String name of column.public float getFloat(java.lang.String name)
name
- A String with the name of the key.public float getFloat(java.lang.String table, java.lang.String column)
table
- String name of table.column
- String name of column.public java.lang.Integer getInteger(java.lang.String name)
name
- A String with the name of the key.public java.lang.Integer getInteger(java.lang.String table, java.lang.String column)
table
- String name of table.column
- String name of column.public int getInt(java.lang.String name)
name
- A String with the name of the key.public int getInt(java.lang.String table, java.lang.String column)
table
- String name of table.column
- String name of column.public java.math.BigDecimal getBigDecimal(java.lang.String name)
name
- A String with the name of the key.public java.math.BigDecimal getBigDecimal(java.lang.String table, java.lang.String column)
table
- String name of table.column
- String name of column.public long getLong(java.lang.String name)
name
- A String with the name of the key.public long getLong(java.lang.String table, java.lang.String column)
table
- String name of table.column
- String name of column.public java.lang.String getString(java.lang.String name)
name
- A String with the name of the key.public java.lang.String getString(java.lang.String table, java.lang.String column)
table
- String name of table.column
- String name of column.public java.lang.String getTableName(java.lang.String name)
name
- A String with the name of the key.public java.util.Vector getVector(java.lang.String name)
name
- A String with the name of the key.public java.util.Vector getVector(java.lang.String table, java.lang.String column)
table
- String name of table.column
- String name of column.public java.lang.Object getValue(java.lang.String name)
name
- A String with the name of the key.public java.lang.Object getValue(java.lang.String table, java.lang.String column)
table
- String name of table.column
- String name of column.public ObjectKey getObjectKey(java.lang.String name)
name
- A String with the name of the key.public ObjectKey getObjectKey(java.lang.String table, java.lang.String column)
table
- String name of table.column
- String name of column.public java.lang.Object get(java.lang.Object key)
get
in class java.util.Hashtable
key
- An Object.public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in class java.util.Hashtable
key
- An Object. Must be instanceof String!value
- An Object.java.lang.NullPointerException
- if key != String or key/value is null.public void putAll(java.util.Map t)
putAll
in class java.util.Hashtable
t
- Mappings to be stored in this map.public Criteria add(java.lang.String key, java.lang.Object value)
Criteria crit = new Criteria().add("column",
"value" );
An EQUAL comparison is used for column and value.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the add(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.public Criteria add(java.lang.String column, java.lang.Object value, java.lang.String comparison)
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.
column
- The column to run the comparison onvalue
- An Object.comparison
- A String.public Criteria add(java.lang.String table, java.lang.String column, java.lang.Object value)
Criteria crit = new Criteria().add("table",
"column",
"value" );
An EQUAL comparison is used for column and value.
table
- Name of the table which contains the columncolumn
- The column to run the comparison onvalue
- An Object.comparison
- String describing how to compare the column with the valuepublic Criteria add(java.lang.String table, java.lang.String column, java.lang.Object value, java.lang.String comparison)
Criteria crit = new Criteria().add("table",
"column",
"value",
"Criterion.GREATER_THAN");
Any comparison can be used.
table
- Name of table which contains the columncolumn
- The column to run the comparison onvalue
- An Object.comparison
- String describing how to compare the column with the valuepublic Criteria add(java.lang.String column, boolean value)
add(column, new Boolean(value), EQUAL);
column
- The column to run the comparison onvalue
- A Boolean.public Criteria add(java.lang.String column, boolean value, java.lang.String comparison)
add(column, new Boolean(value), comparison);
column
- The column to run the comparison onvalue
- A Boolean.comparison
- String describing how to compare the column with the valuepublic Criteria add(java.lang.String column, int value)
add(column, new Integer(value), EQUAL);
column
- The column to run the comparison onvalue
- An int.public Criteria add(java.lang.String column, int value, java.lang.String comparison)
add(column, new Integer(value), comparison);
column
- The column to run the comparison onvalue
- An int.comparison
- String describing how to compare the column with the valuepublic Criteria add(java.lang.String column, long value)
add(column, new Long(value), EQUAL);
column
- The column to run the comparison onvalue
- A long.public Criteria add(java.lang.String column, long value, java.lang.String comparison)
add(column, new Long(value), comparison);
column
- The column to run the comparison onvalue
- A long.comparison
- String describing how to compare the column with the valuepublic Criteria add(java.lang.String column, float value)
add(column, new Float(value), EQUAL);
column
- The column to run the comparison onvalue
- A float.public Criteria add(java.lang.String column, float value, java.lang.String comparison)
add(column, new Float(value), comparison);
column
- The column to run the comparison onvalue
- A float.comparison
- String describing how to compare the column with the valuepublic Criteria add(java.lang.String column, double value)
add(column, new Double(value), EQUAL);
column
- The column to run the comparison onvalue
- A double.public Criteria add(java.lang.String column, double value, java.lang.String comparison)
add(column, new Double(value), comparison);
column
- The column to run the comparison onvalue
- A double.comparison
- String describing how to compare the column with the valuepublic Criteria addTime(java.lang.String column, int year, int month, int date)
public Criteria addTime(java.lang.String column, int year, int month, int date, java.lang.String comparison)
public Criteria addDate(java.lang.String column, int year, int month, int date)
add(column, new GregorianCalendar(year, month,date), EQUAL);
column
- A String value to use as column.year
- An int with the year.month
- An int with the month.date
- An int with the date.public Criteria addDate(java.lang.String column, int year, int month, int date, java.lang.String comparison)
add(column, new GregorianCalendar(year, month,date), comparison);
column
- The column to run the comparison onyear
- An int with the year.month
- An int with the month.date
- An int with the date.comparison
- String describing how to compare the column with the valuepublic Criteria addJoin(java.lang.String left, java.lang.String right)
AND PROJECT.PROJECT_ID=FOO.PROJECT_ID
left = PROJECT.PROJECT_ID right = FOO.PROJECT_ID
left
- A String with the left side of the join.right
- A String with the right side of the join.public java.util.List getJoinL()
public java.util.List getJoinR()
public Criteria addIn(java.lang.String column, java.lang.Object[] values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is replaced.
column
- The column to run the comparison onvalues
- An Object[] with the allowed values.public Criteria addIn(java.lang.String column, int[] values)
FOO.ID IN ('2', '3', '7')
where 'values' contains those three integers. If a criterion for the requested column already exists, it is replaced.
column
- The column to run the comparison onvalues
- An int[] with the allowed values.public Criteria addIn(java.lang.String column, java.util.List values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is replaced.
column
- The column to run the comparison onvalues
- A List with the allowed values.public Criteria addNotIn(java.lang.String column, java.lang.Object[] values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is replaced.
column
- The column to run the comparison onvalues
- An Object[] with the disallowed values.public Criteria addNotIn(java.lang.String column, int[] values)
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.
column
- The column to run the comparison onvalues
- An int[] with the disallowed values.public Criteria addNotIn(java.lang.String column, java.util.List values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is replaced.
column
- The column to run the comparison onvalues
- A List with the disallowed values.public void setAll()
public void setDistinct()
public Criteria setIgnoreCase(boolean b)
b
- True if case should be ignored.public boolean isIgnoreCase()
public Criteria setSingleRecord(boolean b)
b
- True if a single record should be returned.public boolean isSingleRecord()
public Criteria setCascade(boolean b)
b
- True if cascade is set.public boolean isCascade()
public Criteria setLimit(int limit)
limit
- An int with the value for limit.public int getLimit()
public Criteria setOffset(int offset)
offset
- An int with the value for offset.public int getOffset()
public Criteria addSelectColumn(java.lang.String name)
name
- A String with the name of the select column.public StringStackBuffer getSelectColumns()
public StringStackBuffer getSelectModifiers()
public Criteria addOrderByColumn(java.lang.String name)
public Criteria addAscendingOrderByColumn(java.lang.String name)
name
- The name of the column to order by.public Criteria addDescendingOrderByColumn(java.lang.String name)
name
- The name of the column to order by.public StringStackBuffer getOrderByColumns()
public java.lang.Object remove(java.lang.String key)
key
- A String with the key to be removed.public java.lang.String toString()
toString
in class java.util.Hashtable
public boolean equals(java.lang.Object crit)
equals
in class java.util.Hashtable
public Criteria and(Criteria.Criterion c)
Criteria crit = new Criteria();
Criteria.Criterion c = crit.getNewCriterion(BasePeer.ID, new Integer(5), Criteria.LESS_THAN);
crit.and(c);
c
- A Criterion objectpublic Criteria and(java.lang.String column, java.lang.Object value)
Criteria crit = new Criteria().and("column",
"value" );
An EQUAL comparison is used for column and value.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the and(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.public Criteria and(java.lang.String column, java.lang.Object value, java.lang.String comparison)
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.
column
- The column to run the comparison onvalue
- An Object.comparison
- A String.public Criteria and(java.lang.String table, java.lang.String column, java.lang.Object value)
Criteria crit = new Criteria().and("table",
"column",
"value" );
An EQUAL comparison is used for column and value.
table
- Name of the table which contains the columncolumn
- The column to run the comparison onvalue
- An Object.comparison
- String describing how to compare the column with the valuepublic Criteria and(java.lang.String table, java.lang.String column, java.lang.Object value, java.lang.String comparison)
Criteria crit = new Criteria().and("table",
"column",
"value",
"Criterion.GREATER_THAN");
Any comparison can be used.
table
- Name of table which contains the columncolumn
- The column to run the comparison onvalue
- An Object.comparison
- String describing how to compare the column with the valuepublic Criteria and(java.lang.String column, boolean value)
and(column, new Boolean(value), EQUAL);
column
- The column to run the comparison onvalue
- A Boolean.public Criteria and(java.lang.String column, boolean value, java.lang.String comparison)
and(column, new Boolean(value), comparison);
column
- The column to run the comparison onvalue
- A Boolean.comparison
- String describing how to compare the column with the valuepublic Criteria and(java.lang.String column, int value)
and(column, new Integer(value), EQUAL);
column
- The column to run the comparison onvalue
- An int.public Criteria and(java.lang.String column, int value, java.lang.String comparison)
and(column, new Integer(value), comparison);
column
- The column to run the comparison onvalue
- An int.comparison
- String describing how to compare the column with the valuepublic Criteria and(java.lang.String column, long value)
and(column, new Long(value), EQUAL);
column
- The column to run the comparison onvalue
- A long.public Criteria and(java.lang.String column, long value, java.lang.String comparison)
and(column, new Long(value), comparison);
column
- The column to run the comparison onvalue
- A long.comparison
- String describing how to compare the column with the valuepublic Criteria and(java.lang.String column, float value)
and(column, new Float(value), EQUAL);
column
- The column to run the comparison onvalue
- A float.public Criteria and(java.lang.String column, float value, java.lang.String comparison)
and(column, new Float(value), comparison);
column
- The column to run the comparison onvalue
- A float.comparison
- String describing how to compare the column with the valuepublic Criteria and(java.lang.String column, double value)
and(column, new Double(value), EQUAL);
column
- The column to run the comparison onvalue
- A double.public Criteria and(java.lang.String column, double value, java.lang.String comparison)
and(column, new Double(value), comparison);
column
- The column to run the comparison onvalue
- A double.comparison
- String describing how to compare the column with the valuepublic Criteria andDate(java.lang.String column, int year, int month, int date)
and(column, new GregorianCalendar(year, month,date), EQUAL);
column
- A String value to use as column.year
- An int with the year.month
- An int with the month.date
- An int with the date.public Criteria andDate(java.lang.String column, int year, int month, int date, java.lang.String comparison)
and(column, new GregorianCalendar(year, month,date), comparison);
column
- The column to run the comparison onyear
- An int with the year.month
- An int with the month.date
- An int with the date.comparison
- String describing how to compare the column with the valuepublic Criteria andIn(java.lang.String column, java.lang.Object[] values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
column
- The column to run the comparison onvalues
- An Object[] with the allowed values.public Criteria andIn(java.lang.String column, int[] values)
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.
column
- The column to run the comparison onvalues
- An int[] with the allowed values.public Criteria andIn(java.lang.String column, java.util.Vector values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
column
- The column to run the comparison onvalues
- A Vector with the allowed values.public Criteria andNotIn(java.lang.String column, java.lang.Object[] values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
column
- The column to run the comparison onvalues
- An Object[] with the disallowed values.public Criteria andNotIn(java.lang.String column, int[] values)
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.
column
- The column to run the comparison onvalues
- An int[] with the disallowed values.public Criteria andNotIn(java.lang.String column, java.util.Vector values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
column
- The column to run the comparison onvalues
- A Vector with the disallowed values.public Criteria or(Criteria.Criterion c)
Criteria crit = new Criteria();
Criteria.Criterion c = crit.getNewCriterion(BasePeer.ID, new Integer(5), Criteria.LESS_THAN);
crit.or(c);
c
- A Criterion objectpublic Criteria or(java.lang.String column, java.lang.Object value)
Criteria crit = new Criteria().or("column",
"value" );
An EQUAL comparison is used for column and value.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the or(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.public Criteria or(java.lang.String column, java.lang.Object value, java.lang.String comparison)
Criteria crit = new Criteria().or("column",
"value"
"Criterion.GREATER_THAN");
Any comparison can be used.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'. If you
don't like this, you can use the or(table, column, value) method.
column
- The column to run the comparison onvalue
- An Object.comparison
- A String.public Criteria or(java.lang.String table, java.lang.String column, java.lang.Object value)
Criteria crit = new Criteria().or("table",
"column",
"value" );
An EQUAL comparison is used for column and value.
table
- Name of the table which contains the columncolumn
- The column to run the comparison onvalue
- An Object.comparison
- String describing how to compare the column with the valuepublic Criteria or(java.lang.String table, java.lang.String column, java.lang.Object value, java.lang.String comparison)
Criteria crit = new Criteria().or("table",
"column",
"value",
"Criterion.GREATER_THAN");
Any comparison can be used.
table
- Name of table which contains the columncolumn
- The column to run the comparison onvalue
- An Object.comparison
- String describing how to compare the column with the valuepublic Criteria or(java.lang.String column, boolean value)
or(column, new Boolean(value), EQUAL);
column
- The column to run the comparison onvalue
- A Boolean.public Criteria or(java.lang.String column, boolean value, java.lang.String comparison)
or(column, new Boolean(value), comparison);
column
- The column to run the comparison onvalue
- A Boolean.comparison
- String describing how to compare the column with the valuepublic Criteria or(java.lang.String column, int value)
or(column, new Integer(value), EQUAL);
column
- The column to run the comparison onvalue
- An int.public Criteria or(java.lang.String column, int value, java.lang.String comparison)
or(column, new Integer(value), comparison);
column
- The column to run the comparison onvalue
- An int.comparison
- String describing how to compare the column with the valuepublic Criteria or(java.lang.String column, long value)
or(column, new Long(value), EQUAL);
column
- The column to run the comparison onvalue
- A long.public Criteria or(java.lang.String column, long value, java.lang.String comparison)
or(column, new Long(value), comparison);
column
- The column to run the comparison onvalue
- A long.comparison
- String describing how to compare the column with the valuepublic Criteria or(java.lang.String column, float value)
or(column, new Float(value), EQUAL);
column
- The column to run the comparison onvalue
- A float.public Criteria or(java.lang.String column, float value, java.lang.String comparison)
or(column, new Float(value), comparison);
column
- The column to run the comparison onvalue
- A float.comparison
- String describing how to compare the column with the valuepublic Criteria or(java.lang.String column, double value)
or(column, new Double(value), EQUAL);
column
- The column to run the comparison onvalue
- A double.public Criteria or(java.lang.String column, double value, java.lang.String comparison)
or(column, new Double(value), comparison);
column
- The column to run the comparison onvalue
- A double.comparison
- String describing how to compare the column with the valuepublic Criteria orDate(java.lang.String column, int year, int month, int date)
or(column, new GregorianCalendar(year, month,date), EQUAL);
column
- A String value to use as column.year
- An int with the year.month
- An int with the month.date
- An int with the date.public Criteria orDate(java.lang.String column, int year, int month, int date, java.lang.String comparison)
or(column, new GregorianCalendar(year, month,date), comparison);
column
- The column to run the comparison onyear
- An int with the year.month
- An int with the month.date
- An int with the date.comparison
- String describing how to compare the column with the valuepublic Criteria orIn(java.lang.String column, java.lang.Object[] values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
column
- The column to run the comparison onvalues
- An Object[] with the allowed values.public Criteria orIn(java.lang.String column, int[] values)
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.
column
- The column to run the comparison onvalues
- An int[] with the allowed values.public Criteria orIn(java.lang.String column, java.util.Vector values)
FOO.NAME IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
column
- The column to run the comparison onvalues
- A Vector with the allowed values.public Criteria orNotIn(java.lang.String column, java.lang.Object[] values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
column
- The column to run the comparison onvalues
- An Object[] with the disallowed values.public Criteria orNotIn(java.lang.String column, int[] values)
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.
column
- The column to run the comparison onvalues
- An int[] with the disallowed values.public Criteria orNotIn(java.lang.String column, java.util.Vector values)
FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')
where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
column
- The column to run the comparison onvalues
- A Vector with the disallowed values.public void setBlobFlag()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |