Java Doc for Criteria.java in  » Database-ORM » Torque » org » apache » torque » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » Torque » org.apache.torque.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.util.Hashtable
   org.apache.torque.util.Criteria

Criteria
public class Criteria extends Hashtable (Code)
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.
author:
   Frank Y. Kim
author:
   John D. McNally
author:
   Brett McLaughlin
author:
   Eric Dobbs
author:
   Henning P. Schmiedehausen
author:
   Sam Joseph
author:
   Martin Poeschl
author:
   Thomas Fischer
author:
   Scott Eade
author:
   Thomas Vandahl
version:
   $Id: Criteria.java 591648 2007-11-03 16:34:00Z tfischer $

Inner Class :final public class Criterion implements Serializable
Inner Class :public static class Join

Field Summary
final public static  SqlEnumALL
     Comparison type.
final public static  SqlEnumALT_NOT_EQUAL
     Comparison type.
final public static  SqlEnumCURRENT_DATE
    
final public static  SqlEnumCURRENT_TIME
    
final public static  SqlEnumCUSTOM
     Comparison type.
final public static  SqlEnumDISTINCT
     Comparison type.
final public static  SqlEnumEQUAL
     Comparison type.
final public static  SqlEnumGREATER_EQUAL
     Comparison type.
final public static  SqlEnumGREATER_THAN
     Comparison type.
final public static  SqlEnumILIKE
     Comparison type.
final public static  SqlEnumIN
     Comparison type.
final public static  SqlEnumINNER_JOIN
    
final public static  SqlEnumISNOTNULL
    
final public static  SqlEnumISNULL
    
final public static  SqlEnumJOIN
     Comparison type.
final public static  SqlEnumLEFT_JOIN
    
final public static  SqlEnumLESS_EQUAL
     Comparison type.
final public static  SqlEnumLESS_THAN
     Comparison type.
final public static  SqlEnumLIKE
     Comparison type.
final public static  SqlEnumNOT_EQUAL
     Comparison type.
final public static  SqlEnumNOT_ILIKE
     Comparison type.
final public static  SqlEnumNOT_IN
     Comparison type.
final public static  SqlEnumNOT_LIKE
     Comparison type.
final public static  SqlEnumRIGHT_JOIN
    

Constructor Summary
public  Criteria()
     Creates a new instance with the default capacity.
public  Criteria(int initialCapacity)
     Creates a new instance with the specified capacity.
public  Criteria(String dbName)
     Creates a new instance with the default capacity which corresponds to the specified database.
public  Criteria(String dbName, int initialCapacity)
     Creates a new instance with the specified capacity which corresponds to the specified database.

Method Summary
public  Criteriaadd(Criterion c)
     This method adds a prepared Criterion object to the Criteria. You can get a new, empty Criterion object with the getNewCriterion() method.
public  Criteriaadd(String column, Object value)
     This method adds a new criterion to the list of criterias.
public  Criteriaadd(String column, Object value, SqlEnum comparison)
     This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is replaced.
public  Criteriaadd(String table, String column, Object value)
     This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is replaced.
public  Criteriaadd(String table, String column, Object value, SqlEnum comparison)
     This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is replaced.
public  Criteriaadd(String column, boolean value)
     Convenience method to add a boolean to Criteria. Equal to

add(column, new Boolean(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A Boolean.

public  Criteriaadd(String column, boolean value, SqlEnum comparison)
     Convenience method to add a boolean to Criteria.
public  Criteriaadd(String column, int value)
     Convenience method to add an int to Criteria. Equal to

add(column, new Integer(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An int.

public  Criteriaadd(String column, int value, SqlEnum comparison)
     Convenience method to add an int to Criteria.
public  Criteriaadd(String column, long value)
     Convenience method to add a long to Criteria. Equal to

add(column, new Long(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A long.

public  Criteriaadd(String column, long value, SqlEnum comparison)
     Convenience method to add a long to Criteria.
public  Criteriaadd(String column, float value)
     Convenience method to add a float to Criteria. Equal to

add(column, new Float(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A float.

public  Criteriaadd(String column, float value, SqlEnum comparison)
     Convenience method to add a float to Criteria.
public  Criteriaadd(String column, double value)
     Convenience method to add a double to Criteria. Equal to

add(column, new Double(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A double.

public  Criteriaadd(String column, double value, SqlEnum comparison)
     Convenience method to add a double to Criteria.
public  voidaddAlias(String alias, String table)
     Allows one to specify an alias for a table that can be used in various parts of the SQL.
public  CriteriaaddAsColumn(String name, String clause)
     Add an AS clause to the select columns.
public  CriteriaaddAscendingOrderByColumn(String name)
     Add order by column name, explicitly specifying ascending.
Parameters:
  name - The name of the column to order by.
public  CriteriaaddDate(String column, int year, int month, int date)
     Convenience method to add a Date object specified by year, month, and date into the Criteria. Equal to

add(column, new GregorianCalendar(year, month,date), EQUAL);
Parameters:
  column - A String value to use as column.
Parameters:
  year - An int with the year.
Parameters:
  month - An int with the month.

public  CriteriaaddDate(String column, int year, int month, int date, SqlEnum comparison)
     Convenience method to add a Date object specified by year, month, and date into the Criteria. Equal to

add(column, new GregorianCalendar(year, month,date), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  year - An int with the year.
Parameters:
  month - An int with the month.

public  CriteriaaddDescendingOrderByColumn(String name)
     Add order by column name, explicitly specifying descending.
Parameters:
  name - The name of the column to order by.
public  CriteriaaddGroupByColumn(String groupBy)
     Add group by column name.
Parameters:
  groupBy - The name of the column to group by.
public  CriteriaaddHaving(Criterion having)
     This method adds a prepared Criterion object to the Criteria as a having clause.
public  CriteriaaddIn(String column, Object[] values)
     Adds an 'IN' clause with the criteria supplied as an Object array.
public  CriteriaaddIn(String column, int[] values)
     Adds an 'IN' clause with the criteria supplied as an int array. For example:

FOO.ID IN ('2', '3', '7')

where 'values' contains those three integers. If a criterion for the requested column already exists, it is replaced.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An int[] with the allowed values.

public  CriteriaaddIn(String column, List values)
     Adds an 'IN' clause with the criteria supplied as a List. For example:

FOO.NAME IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is replaced.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - A List with the allowed values.

public  CriteriaaddJoin(String left, String right)
     This is the way that you should add a join of two tables.
public  CriteriaaddJoin(String left, String right, SqlEnum operator)
     This is the way that you should add a join of two tables.
public  CriteriaaddNotIn(String column, Object[] values)
     Adds a 'NOT IN' clause with the criteria supplied as an Object array.
public  CriteriaaddNotIn(String column, int[] values)
     Adds a 'NOT IN' clause with the criteria supplied as an int array.
public  CriteriaaddNotIn(String column, List values)
     Adds a 'NOT IN' clause with the criteria supplied as a List. For example:

FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is replaced.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - A List with the disallowed values.

public  CriteriaaddSelectColumn(String name)
     Add select column.
Parameters:
  name - A String with the name of the select column.
public  Criteriaand(Criterion c)
     This method adds a prepared Criterion object to the Criteria. You can get a new, empty Criterion object with the getNewCriterion() method.
public  Criteriaand(String column, Object value)
     This method adds a new criterion to the list of criterias.
public  Criteriaand(String column, Object value, SqlEnum comparison)
     This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
public  Criteriaand(String table, String column, Object value)
     This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
public  Criteriaand(String table, String column, Object value, SqlEnum comparison)
     This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
public  Criteriaand(String column, boolean value)
     Convenience method to add a boolean to Criteria. Equal to

and(column, new Boolean(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A Boolean.

public  Criteriaand(String column, boolean value, SqlEnum comparison)
     Convenience method to add a boolean to Criteria.
public  Criteriaand(String column, int value)
     Convenience method to add an int to Criteria. Equal to

and(column, new Integer(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An int.

public  Criteriaand(String column, int value, SqlEnum comparison)
     Convenience method to add an int to Criteria.
public  Criteriaand(String column, long value)
     Convenience method to add a long to Criteria. Equal to

and(column, new Long(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A long.

public  Criteriaand(String column, long value, SqlEnum comparison)
     Convenience method to add a long to Criteria.
public  Criteriaand(String column, float value)
     Convenience method to add a float to Criteria. Equal to

and(column, new Float(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A float.

public  Criteriaand(String column, float value, SqlEnum comparison)
     Convenience method to add a float to Criteria.
public  Criteriaand(String column, double value)
     Convenience method to add a double to Criteria. Equal to

and(column, new Double(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A double.

public  Criteriaand(String column, double value, SqlEnum comparison)
     Convenience method to add a double to Criteria.
public  CriteriaandDate(String column, int year, int month, int date)
     Convenience method to add a Date object specified by year, month, and date into the Criteria. Equal to

and(column, new GregorianCalendar(year, month,date), EQUAL);
Parameters:
  column - A String value to use as column.
Parameters:
  year - An int with the year.
Parameters:
  month - An int with the month.
Parameters:
  date - An int with the date.

public  CriteriaandDate(String column, int year, int month, int date, SqlEnum comparison)
     Convenience method to add a Date object specified by year, month, and date into the Criteria.
public  CriteriaandIn(String column, Object[] values)
     Adds an 'IN' clause with the criteria supplied as an Object array. For example:

FOO.NAME IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An Object[] with the allowed values.

public  CriteriaandIn(String column, int[] values)
     Adds an 'IN' clause with the criteria supplied as an int array. For example:

FOO.ID IN ('2', '3', '7')

where 'values' contains those three integers. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An int[] with the allowed values.

public  CriteriaandIn(String column, List values)
     Adds an 'IN' clause with the criteria supplied as a List. For example:

FOO.NAME IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - A List with the allowed values.

public  CriteriaandNotIn(String column, Object[] values)
     Adds a 'NOT IN' clause with the criteria supplied as an Object array.
public  CriteriaandNotIn(String column, int[] values)
     Adds a 'NOT IN' clause with the criteria supplied as an int array.
public  CriteriaandNotIn(String column, List values)
     Adds a 'NOT IN' clause with the criteria supplied as a List. For example:

FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - A List with the disallowed values.

public  voidclear()
     Brings this criteria back to its initial state, so that it can be reused as if it was new.
public  booleancontainsKey(String table, String column)
     Does this Criteria Object contain the specified key?
Parameters:
  table - The name of the table.
Parameters:
  column - The name of the column.
public  booleanequals(Object crit)
     This method checks another Criteria to see if they contain the same attributes and hashtable entries.
public  Objectget(Object key)
     Overrides Hashtable get, so that the value placed in the Criterion is returned instead of the Criterion.
Parameters:
  key - An Object.
public  MapgetAliases()
     Get the table aliases.
public  MapgetAsColumns()
     Get the column aliases.
public  BigDecimalgetBigDecimal(String name)
     Convenience method to return a BigDecimal.
Parameters:
  name - A String with the name of the key.
public  BigDecimalgetBigDecimal(String table, String column)
     Convenience method to return a BigDecimal.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column.
public  booleangetBoolean(String column)
     Convenience method to return value as a boolean.
Parameters:
  column - String name of column.
public  booleangetBoolean(String table, String column)
     Convenience method to return value as a boolean.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column.
public  StringgetColumnName(String name)
     Method to return a String table name.
Parameters:
  name - A String with the name of the key.
public  SqlEnumgetComparison(String key)
     Method to return a comparison String.
Parameters:
  key - String name of the key.
public  SqlEnumgetComparison(String table, String column)
     Method to return a comparison String.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column.
public  CriteriongetCriterion(String column)
     Method to return criteria related to columns in a table.
Parameters:
  column - String name of column.
public  CriteriongetCriterion(String table, String column)
     Method to return criteria related to a column in a table.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column.
public  java.util.DategetDate(String name)
     Convenience method to return a Date.
public  java.util.DategetDate(String table, String column)
     Convenience method to return a Date.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column.
public  StringgetDbName()
     Get the Database(Map) name. A String with the Database(Map) name.
public  doublegetDouble(String name)
     Convenience method to return a double.
Parameters:
  name - A String with the name of the key.
public  doublegetDouble(String table, String column)
     Convenience method to return a double.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column.
public  floatgetFloat(String name)
     Convenience method to return a float.
Parameters:
  name - A String with the name of the key.
public  floatgetFloat(String table, String column)
     Convenience method to return a float.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column.
public  UniqueListgetGroupByColumns()
     Get group by columns.
public  CriteriongetHaving()
     Get Having Criterion.
public  intgetInt(String name)
     Convenience method to return an int.
Parameters:
  name - A String with the name of the key.
public  intgetInt(String table, String column)
     Convenience method to return an int.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column.
public  IntegergetInteger(String name)
     Convenience method to return an Integer.
Parameters:
  name - A String with the name of the key.
public  IntegergetInteger(String table, String column)
     Convenience method to return an Integer.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column.
public  ListgetJoinL()
     get one side of the set of possible joins.
public  ListgetJoinR()
     get one side of the set of possible joins.
public  ListgetJoins()
     get the List of Joins.
public  intgetLimit()
     Get limit.
public  ListgetList(String name)
     Convenience method to return a List.
Parameters:
  name - A String with the name of the key.
public  ListgetList(String table, String column)
     Convenience method to return a List.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column.
public  longgetLong(String name)
     Convenience method to return a long.
Parameters:
  name - A String with the name of the key.
public  longgetLong(String table, String column)
     Convenience method to return a long.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column.
public  CriteriongetNewCriterion(String column, Object value, SqlEnum comparison)
     Method to return criterion that is not added automatically to this Criteria.
public  CriteriongetNewCriterion(String table, String column, Object value, SqlEnum comparison)
     Method to return criterion that is not added automatically to this Criteria.
public  ObjectKeygetObjectKey(String name)
     Convenience method to return an ObjectKey.
Parameters:
  name - A String with the name of the key.
public  ObjectKeygetObjectKey(String table, String column)
     Convenience method to return an ObjectKey.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column.
public  intgetOffset()
     Get offset.
public  UniqueListgetOrderByColumns()
     Get order by columns.
public  UniqueListgetSelectColumns()
     Get select columns.
public  UniqueListgetSelectModifiers()
     Get select modifiers.
public  StringgetString(String name)
     Convenience method to return a String.
Parameters:
  name - A String with the name of the key.
public  StringgetString(String table, String column)
     Convenience method to return a String.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column.
public  StringgetTableForAlias(String alias)
     Returns the table name associated with an alias.
public  StringgetTableName(String name)
     Method to return a String table name.
Parameters:
  name - A String with the name of the key.
public  ObjectgetValue(String name)
     Method to return the value that was added to Criteria.
Parameters:
  name - A String with the name of the key.
public  ObjectgetValue(String table, String column)
     Method to return the value that was added to Criteria.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column.
public  inthashCode()
     Returns the hash code value for this Join.
public  booleanisCascade()
    
public  booleanisIgnoreCase()
    
public  booleanisSingleRecord()
    
protected  booleanisUseTransaction()
     called by BasePeer to determine whether the sql command specified by this criteria must be wrapped in a transaction.
public  Criteriaor(Criterion c)
     This method adds a prepared Criterion object to the Criteria. You can get a new, empty Criterion object with the getNewCriterion() method.
public  Criteriaor(String column, Object value)
     This method adds a new criterion to the list of criterias.
public  Criteriaor(String column, Object value, SqlEnum comparison)
     This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
public  Criteriaor(String table, String column, Object value)
     This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
public  Criteriaor(String table, String column, Object value, SqlEnum comparison)
     This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
public  Criteriaor(String column, boolean value)
     Convenience method to add a boolean to Criteria. Equal to

or(column, new Boolean(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A Boolean.

public  Criteriaor(String column, boolean value, SqlEnum comparison)
     Convenience method to add a boolean to Criteria.
public  Criteriaor(String column, int value)
     Convenience method to add an int to Criteria. Equal to

or(column, new Integer(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An int.

public  Criteriaor(String column, int value, SqlEnum comparison)
     Convenience method to add an int to Criteria.
public  Criteriaor(String column, long value)
     Convenience method to add a long to Criteria. Equal to

or(column, new Long(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A long.

public  Criteriaor(String column, long value, SqlEnum comparison)
     Convenience method to add a long to Criteria.
public  Criteriaor(String column, float value)
     Convenience method to add a float to Criteria. Equal to

or(column, new Float(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A float.

public  Criteriaor(String column, float value, SqlEnum comparison)
     Convenience method to add a float to Criteria.
public  Criteriaor(String column, double value)
     Convenience method to add a double to Criteria. Equal to

or(column, new Double(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A double.

public  Criteriaor(String column, double value, SqlEnum comparison)
     Convenience method to add a double to Criteria.
public  CriteriaorDate(String column, int year, int month, int date)
     Convenience method to add a Date object specified by year, month, and date into the Criteria. Equal to

or(column, new GregorianCalendar(year, month,date), EQUAL);
Parameters:
  column - A String value to use as column.
Parameters:
  year - An int with the year.
Parameters:
  month - An int with the month.
Parameters:
  date - An int with the date.

public  CriteriaorDate(String column, int year, int month, int date, SqlEnum comparison)
     Convenience method to add a Date object specified by year, month, and date into the Criteria.
public  CriteriaorIn(String column, Object[] values)
     Adds an 'IN' clause with the criteria supplied as an Object array.
public  CriteriaorIn(String column, int[] values)
     Adds an 'IN' clause with the criteria supplied as an int array. For example:

FOO.ID IN ('2', '3', '7')

where 'values' contains those three integers. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An int[] with the allowed values.

public  CriteriaorIn(String column, List values)
     Adds an 'IN' clause with the criteria supplied as a List. For example:

FOO.NAME IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - A List with the allowed values.

public  CriteriaorNotIn(String column, Object[] values)
     Adds a 'NOT IN' clause with the criteria supplied as an Object array.
public  CriteriaorNotIn(String column, int[] values)
     Adds a 'NOT IN' clause with the criteria supplied as an int array.
public  CriteriaorNotIn(String column, List values)
     Adds a 'NOT IN' clause with the criteria supplied as a List. For example:

FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - A List with the disallowed values.

public  Objectput(Object key, Object value)
     Overrides Hashtable put, so that this object is returned instead of the value previously in the Criteria object. The reason is so that it more closely matches the behavior of the add() methods.
public synchronized  voidputAll(Map t)
     Copies all of the mappings from the specified Map to this Criteria These mappings will replace any mappings that this Criteria had for any of the keys currently in the specified Map.
public  Objectremove(String key)
     Remove an object from the criteria.
Parameters:
  key - A String with the key to be removed.
public  voidsetAll()
     Adds "ALL " to the SQL statement.
public  CriteriasetCascade(boolean b)
     Set cascade.
Parameters:
  b - True if cascade is set.
public  voidsetDbName(String dbName)
     Set the DatabaseMap name.
public  voidsetDistinct()
     Adds "DISTINCT " to the SQL statement.
public  CriteriasetIgnoreCase(boolean b)
     Sets ignore case.
Parameters:
  b - True if case should be ignored.
public  CriteriasetLimit(int limit)
     Set limit.
Parameters:
  limit - An int with the value for limit.
public  CriteriasetOffset(int offset)
     Set offset.
Parameters:
  offset - An int with the value for offset.
public  CriteriasetSingleRecord(boolean b)
     Set single record? Set this to true if you expect the query to result in only a single result record (the default behaviour is to throw a TorqueException if multiple records are returned when the query is executed).
public  voidsetUseTransaction(boolean v)
     Will force the sql represented by this criteria to be executed within a transaction.
public  StringtoString()
     Build a string representation of the Criteria.

Field Detail
ALL
final public static SqlEnum ALL(Code)
Comparison type.



ALT_NOT_EQUAL
final public static SqlEnum ALT_NOT_EQUAL(Code)
Comparison type.



CURRENT_DATE
final public static SqlEnum CURRENT_DATE(Code)
"CURRENT_DATE" ANSI SQL function



CURRENT_TIME
final public static SqlEnum CURRENT_TIME(Code)
"CURRENT_TIME" ANSI SQL function



CUSTOM
final public static SqlEnum CUSTOM(Code)
Comparison type.



DISTINCT
final public static SqlEnum DISTINCT(Code)
Comparison type.



EQUAL
final public static SqlEnum EQUAL(Code)
Comparison type.



GREATER_EQUAL
final public static SqlEnum GREATER_EQUAL(Code)
Comparison type.



GREATER_THAN
final public static SqlEnum GREATER_THAN(Code)
Comparison type.



ILIKE
final public static SqlEnum ILIKE(Code)
Comparison type.



IN
final public static SqlEnum IN(Code)
Comparison type.



INNER_JOIN
final public static SqlEnum INNER_JOIN(Code)
"INNER JOIN" SQL statement



ISNOTNULL
final public static SqlEnum ISNOTNULL(Code)
"IS NOT NULL" null comparison



ISNULL
final public static SqlEnum ISNULL(Code)
"IS NULL" null comparison



JOIN
final public static SqlEnum JOIN(Code)
Comparison type.



LEFT_JOIN
final public static SqlEnum LEFT_JOIN(Code)
"LEFT JOIN" SQL statement



LESS_EQUAL
final public static SqlEnum LESS_EQUAL(Code)
Comparison type.



LESS_THAN
final public static SqlEnum LESS_THAN(Code)
Comparison type.



LIKE
final public static SqlEnum LIKE(Code)
Comparison type.



NOT_EQUAL
final public static SqlEnum NOT_EQUAL(Code)
Comparison type.



NOT_ILIKE
final public static SqlEnum NOT_ILIKE(Code)
Comparison type.



NOT_IN
final public static SqlEnum NOT_IN(Code)
Comparison type.



NOT_LIKE
final public static SqlEnum NOT_LIKE(Code)
Comparison type.



RIGHT_JOIN
final public static SqlEnum RIGHT_JOIN(Code)
"RIGHT JOIN" SQL statement




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



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



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



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




Method Detail
add
public Criteria add(Criterion c)(Code)
This method adds a prepared Criterion object to the Criteria. You can get a new, empty Criterion object with the getNewCriterion() method. If a criterion for the requested column already exists, it is replaced. This is used as follows:

Criteria crit = new Criteria(); Criteria.Criterion c = crit .getNewCriterion(BasePeer.ID, new Integer(5), Criteria.LESS_THAN); crit.add(c);
Parameters:
  c - A Criterion object A modified Criteria object.




add
public Criteria add(String column, Object value)(Code)
This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is replaced. This is used as follows:

Criteria crit = new Criteria().add("column", "value"); An EQUAL comparison is used for column and value. The name of the table must be used implicitly in the column name, so the Column name must be something like 'TABLE.id'. If you don't like this, you can use the add(table, column, value) method.
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An Object. A modified Criteria object.




add
public Criteria add(String column, Object value, SqlEnum comparison)(Code)
This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is replaced. If is used as follow:

Criteria crit = new Criteria().add("column", "value" Criteria.GREATER_THAN); Any comparison can be used. The name of the table must be used implicitly in the column name, so the Column name must be something like 'TABLE.id'. If you don't like this, you can use the add(table, column, value) method.
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An Object.
Parameters:
  comparison - A String. A modified Criteria object.




add
public Criteria add(String table, String column, Object value)(Code)
This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is replaced. If is used as follows:

Criteria crit = new Criteria().add("table", "column", "value"); An EQUAL comparison is used for column and value.
Parameters:
  table - Name of the table which contains the column
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An Object. A modified Criteria object.




add
public Criteria add(String table, String column, Object value, SqlEnum comparison)(Code)
This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is replaced. If is used as follows:

Criteria crit = new Criteria().add("table", "column", "value", Criteria.GREATER_THAN); Any comparison can be used.
Parameters:
  table - Name of table which contains the column
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An Object.
Parameters:
  comparison - String describing how to compare the column withthe value A modified Criteria object.




add
public Criteria add(String column, boolean value)(Code)
Convenience method to add a boolean to Criteria. Equal to

add(column, new Boolean(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A Boolean. A modified Criteria object.




add
public Criteria add(String column, boolean value, SqlEnum comparison)(Code)
Convenience method to add a boolean to Criteria. Equal to

add(column, new Boolean(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A Boolean.
Parameters:
  comparison - String describing how to compare the column withthe value A modified Criteria object.




add
public Criteria add(String column, int value)(Code)
Convenience method to add an int to Criteria. Equal to

add(column, new Integer(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An int. A modified Criteria object.




add
public Criteria add(String column, int value, SqlEnum comparison)(Code)
Convenience method to add an int to Criteria. Equal to

add(column, new Integer(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An int.
Parameters:
  comparison - String describing how to compare the column withthe value A modified Criteria object.




add
public Criteria add(String column, long value)(Code)
Convenience method to add a long to Criteria. Equal to

add(column, new Long(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A long. A modified Criteria object.




add
public Criteria add(String column, long value, SqlEnum comparison)(Code)
Convenience method to add a long to Criteria. Equal to

add(column, new Long(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A long.
Parameters:
  comparison - String describing how to compare the column withthe value A modified Criteria object.




add
public Criteria add(String column, float value)(Code)
Convenience method to add a float to Criteria. Equal to

add(column, new Float(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A float. A modified Criteria object.




add
public Criteria add(String column, float value, SqlEnum comparison)(Code)
Convenience method to add a float to Criteria. Equal to

add(column, new Float(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A float.
Parameters:
  comparison - String describing how to compare the column withthe value A modified Criteria object.




add
public Criteria add(String column, double value)(Code)
Convenience method to add a double to Criteria. Equal to

add(column, new Double(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A double. A modified Criteria object.




add
public Criteria add(String column, double value, SqlEnum comparison)(Code)
Convenience method to add a double to Criteria. Equal to

add(column, new Double(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A double.
Parameters:
  comparison - String describing how to compare the column withthe value A modified Criteria object.




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



addAsColumn
public Criteria addAsColumn(String name, String clause)(Code)
Add an AS clause to the select columns. Usage:

Criteria myCrit = new Criteria(); myCrit.addAsColumn("alias", "ALIAS("+MyPeer.ID+")");
Parameters:
  name - wanted Name of the column
Parameters:
  clause - SQL clause to select from the tableIf the name already exists, it is replaced by the new clause. A modified Criteria object.




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



addDate
public Criteria addDate(String column, int year, int month, int date)(Code)
Convenience method to add a Date object specified by year, month, and date into the Criteria. Equal to

add(column, new GregorianCalendar(year, month,date), EQUAL);
Parameters:
  column - A String value to use as column.
Parameters:
  year - An int with the year.
Parameters:
  month - An int with the month. Month value is 0-based.e.g., 0 for January
Parameters:
  date - An int with the date. A modified Criteria object.




addDate
public Criteria addDate(String column, int year, int month, int date, SqlEnum comparison)(Code)
Convenience method to add a Date object specified by year, month, and date into the Criteria. Equal to

add(column, new GregorianCalendar(year, month,date), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  year - An int with the year.
Parameters:
  month - An int with the month. Month value is 0-based.e.g., 0 for January
Parameters:
  date - An int with the date.
Parameters:
  comparison - String describing how to compare the column withthe value A modified Criteria object.




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



addGroupByColumn
public Criteria addGroupByColumn(String groupBy)(Code)
Add group by column name.
Parameters:
  groupBy - The name of the column to group by. A modified Criteria object.



addHaving
public Criteria addHaving(Criterion having)(Code)
This method adds a prepared Criterion object to the Criteria as a having clause. You can get a new, empty Criterion object with the getNewCriterion() method.

Criteria crit = new Criteria(); Criteria.Criterion c = crit.getNewCriterion(BasePeer.ID, new Integer(5), Criteria.LESS_THAN); crit.addHaving(c);
Parameters:
  having - A Criterion object A modified Criteria object.




addIn
public Criteria addIn(String column, Object[] values)(Code)
Adds an 'IN' clause with the criteria supplied as an Object array. For example:

FOO.NAME IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is replaced.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An Object[] with the allowed values. A modified Criteria object.




addIn
public Criteria addIn(String column, int[] values)(Code)
Adds an 'IN' clause with the criteria supplied as an int array. For example:

FOO.ID IN ('2', '3', '7')

where 'values' contains those three integers. If a criterion for the requested column already exists, it is replaced.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An int[] with the allowed values. A modified Criteria object.




addIn
public Criteria addIn(String column, List values)(Code)
Adds an 'IN' clause with the criteria supplied as a List. For example:

FOO.NAME IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is replaced.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - A List with the allowed values. A modified Criteria object.




addJoin
public Criteria addJoin(String left, String right)(Code)
This is the way that you should add a join of two tables. For example:

AND PROJECT.PROJECT_ID=FOO.PROJECT_ID

left = PROJECT.PROJECT_ID right = FOO.PROJECT_ID
Parameters:
  left - A String with the left side of the join.
Parameters:
  right - A String with the right side of the join. A modified Criteria object.




addJoin
public Criteria addJoin(String left, String right, SqlEnum operator)(Code)
This is the way that you should add a join of two tables. For example:

PROJECT LEFT JOIN FOO ON PROJECT.PROJECT_ID=FOO.PROJECT_ID

left = "PROJECT.PROJECT_ID" right = "FOO.PROJECT_ID" operator = Criteria.LEFT_JOIN
Parameters:
  left - A String with the left side of the join.
Parameters:
  right - A String with the right side of the join.
Parameters:
  operator - The operator used for the join: must be one of null,Criteria.LEFT_JOIN, Criteria.RIGHT_JOIN, Criteria.INNER_JOIN A modified Criteria object.




addNotIn
public Criteria addNotIn(String column, Object[] values)(Code)
Adds a 'NOT IN' clause with the criteria supplied as an Object array. For example:

FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is replaced.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An Object[] with the disallowed values. A modified Criteria object.




addNotIn
public Criteria addNotIn(String column, int[] values)(Code)
Adds a 'NOT IN' clause with the criteria supplied as an int array. For example:

FOO.ID NOT IN ('2', '3', '7')

where 'values' contains those three integers. If a criterion for the requested column already exists, it is replaced.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An int[] with the disallowed values. A modified Criteria object.




addNotIn
public Criteria addNotIn(String column, List values)(Code)
Adds a 'NOT IN' clause with the criteria supplied as a List. For example:

FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is replaced.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - A List with the disallowed values. A modified Criteria object.




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



and
public Criteria and(Criterion c)(Code)
This method adds a prepared Criterion object to the Criteria. You can get a new, empty Criterion object with the getNewCriterion() method. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion. This is used as follows:

Criteria crit = new Criteria(); Criteria.Criterion c = crit.getNewCriterion(BasePeer.ID, new Integer(5), Criteria.LESS_THAN); crit.and(c);
Parameters:
  c - A Criterion object A modified Criteria object.




and
public Criteria and(String column, Object value)(Code)
This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion. This is used as follows:

Criteria crit = new Criteria().and("column", "value"); An EQUAL comparison is used for column and value. The name of the table must be used implicitly in the column name, so the Column name must be something like 'TABLE.id'. If you don't like this, you can use the and(table, column, value) method.
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An Object. A modified Criteria object.




and
public Criteria and(String column, Object value, SqlEnum comparison)(Code)
This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion. If is used as follow:

Criteria crit = new Criteria().and("column", "value" Criteria.GREATER_THAN); Any comparison can be used. The name of the table must be used implicitly in the column name, so the Column name must be something like 'TABLE.id'. If you don't like this, you can use the and(table, column, value) method.
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An Object.
Parameters:
  comparison - A String. A modified Criteria object.




and
public Criteria and(String table, String column, Object value)(Code)
This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion. If is used as follows:

Criteria crit = new Criteria().and("table", "column", "value"); An EQUAL comparison is used for column and value.
Parameters:
  table - Name of the table which contains the column
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An Object. A modified Criteria object.




and
public Criteria and(String table, String column, Object value, SqlEnum comparison)(Code)
This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion. If is used as follows:

Criteria crit = new Criteria().and("table", "column", "value", "Criterion.GREATER_THAN"); Any comparison can be used.
Parameters:
  table - Name of table which contains the column
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An Object.
Parameters:
  comparison - String describing how to compare the column withthe value A modified Criteria object.




and
public Criteria and(String column, boolean value)(Code)
Convenience method to add a boolean to Criteria. Equal to

and(column, new Boolean(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A Boolean. A modified Criteria object.




and
public Criteria and(String column, boolean value, SqlEnum comparison)(Code)
Convenience method to add a boolean to Criteria. Equal to

and(column, new Boolean(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A Boolean.
Parameters:
  comparison - String describing how to compare the columnwith the value A modified Criteria object.




and
public Criteria and(String column, int value)(Code)
Convenience method to add an int to Criteria. Equal to

and(column, new Integer(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An int. A modified Criteria object.




and
public Criteria and(String column, int value, SqlEnum comparison)(Code)
Convenience method to add an int to Criteria. Equal to

and(column, new Integer(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An int.
Parameters:
  comparison - String describing how to compare the column with the value A modified Criteria object.




and
public Criteria and(String column, long value)(Code)
Convenience method to add a long to Criteria. Equal to

and(column, new Long(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A long. A modified Criteria object.




and
public Criteria and(String column, long value, SqlEnum comparison)(Code)
Convenience method to add a long to Criteria. Equal to

and(column, new Long(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A long.
Parameters:
  comparison - String describing how to compare the column withthe value A modified Criteria object.




and
public Criteria and(String column, float value)(Code)
Convenience method to add a float to Criteria. Equal to

and(column, new Float(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A float. A modified Criteria object.




and
public Criteria and(String column, float value, SqlEnum comparison)(Code)
Convenience method to add a float to Criteria. Equal to

and(column, new Float(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A float.
Parameters:
  comparison - String describing how to compare the column withthe value A modified Criteria object.




and
public Criteria and(String column, double value)(Code)
Convenience method to add a double to Criteria. Equal to

and(column, new Double(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A double. A modified Criteria object.




and
public Criteria and(String column, double value, SqlEnum comparison)(Code)
Convenience method to add a double to Criteria. Equal to

and(column, new Double(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A double.
Parameters:
  comparison - String describing how to compare the column withthe value A modified Criteria object.




andDate
public Criteria andDate(String column, int year, int month, int date)(Code)
Convenience method to add a Date object specified by year, month, and date into the Criteria. Equal to

and(column, new GregorianCalendar(year, month,date), EQUAL);
Parameters:
  column - A String value to use as column.
Parameters:
  year - An int with the year.
Parameters:
  month - An int with the month.
Parameters:
  date - An int with the date. A modified Criteria object.




andDate
public Criteria andDate(String column, int year, int month, int date, SqlEnum comparison)(Code)
Convenience method to add a Date object specified by year, month, and date into the Criteria. Equal to

and(column, new GregorianCalendar(year, month,date), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  year - An int with the year.
Parameters:
  month - An int with the month.
Parameters:
  date - An int with the date.
Parameters:
  comparison - String describing how to compare the column withthe value A modified Criteria object.




andIn
public Criteria andIn(String column, Object[] values)(Code)
Adds an 'IN' clause with the criteria supplied as an Object array. For example:

FOO.NAME IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An Object[] with the allowed values. A modified Criteria object.




andIn
public Criteria andIn(String column, int[] values)(Code)
Adds an 'IN' clause with the criteria supplied as an int array. For example:

FOO.ID IN ('2', '3', '7')

where 'values' contains those three integers. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An int[] with the allowed values. A modified Criteria object.




andIn
public Criteria andIn(String column, List values)(Code)
Adds an 'IN' clause with the criteria supplied as a List. For example:

FOO.NAME IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - A List with the allowed values. A modified Criteria object.




andNotIn
public Criteria andNotIn(String column, Object[] values)(Code)
Adds a 'NOT IN' clause with the criteria supplied as an Object array. For example:

FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An Object[] with the disallowed values. A modified Criteria object.




andNotIn
public Criteria andNotIn(String column, int[] values)(Code)
Adds a 'NOT IN' clause with the criteria supplied as an int array. For example:

FOO.ID NOT IN ('2', '3', '7')

where 'values' contains those three integers. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An int[] with the disallowed values. A modified Criteria object.




andNotIn
public Criteria andNotIn(String column, List values)(Code)
Adds a 'NOT IN' clause with the criteria supplied as a List. For example:

FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "AND"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - A List with the disallowed values. A modified Criteria object.




clear
public void clear()(Code)
Brings this criteria back to its initial state, so that it can be reused as if it was new. Except if the criteria has grown in capacity, it is left at the current capacity.



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



equals
public boolean equals(Object crit)(Code)
This method checks another Criteria to see if they contain the same attributes and hashtable entries.



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



getAliases
public Map getAliases()(Code)
Get the table aliases. A Map which maps the table alias names to the actual table names.



getAsColumns
public Map getAsColumns()(Code)
Get the column aliases. A Map which map the column alias namesto the alias clauses.



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



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



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



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



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



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



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



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



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



getDate
public java.util.Date getDate(String name)(Code)
Convenience method to return a Date.
Parameters:
  name - column name (TABLE.COLUMN) A java.util.Date with the value of object at key.



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



getDbName
public String getDbName()(Code)
Get the Database(Map) name. A String with the Database(Map) name. By default, thisis PoolBrokerService.DEFAULT.



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



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



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



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



getGroupByColumns
public UniqueList getGroupByColumns()(Code)
Get group by columns. An UniqueList with the name of the groupBy clause.



getHaving
public Criterion getHaving()(Code)
Get Having Criterion. A Criterion that is the having clause.



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



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



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



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



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



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



getJoins
public List getJoins()(Code)
get the List of Joins. This method is meant to be called by BasePeer. a List which contains objects of type Join.If the criteria does not contains any joins, the list is empty



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



getList
public List getList(String name)(Code)
Convenience method to return a List.
Parameters:
  name - A String with the name of the key. A List with the value of object at key.



getList
public List getList(String table, String column)(Code)
Convenience method to return a List.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column. A List with the value of object at key.



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



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



getNewCriterion
public Criterion getNewCriterion(String column, Object value, SqlEnum comparison)(Code)
Method to return criterion that is not added automatically to this Criteria. This can be used to chain the Criterions to form a more complex where clause.
Parameters:
  column - String full name of column (for example TABLE.COLUMN). A Criterion.



getNewCriterion
public Criterion getNewCriterion(String table, String column, Object value, SqlEnum comparison)(Code)
Method to return criterion that is not added automatically to this Criteria. This can be used to chain the Criterions to form a more complex where clause.
Parameters:
  table - String name of table.
Parameters:
  column - String name of column. A Criterion.



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



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



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



getOrderByColumns
public UniqueList getOrderByColumns()(Code)
Get order by columns. An UniqueList with the name of the order columns.



getSelectColumns
public UniqueList getSelectColumns()(Code)
Get select columns. An StringStack with the name of the selectcolumns.



getSelectModifiers
public UniqueList getSelectModifiers()(Code)
Get select modifiers. An UniqueList with the select modifiers.



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



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



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



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



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



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



hashCode
public int hashCode()(Code)
Returns the hash code value for this Join. a hash code value for this object.



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



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



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



isUseTransaction
protected boolean isUseTransaction()(Code)
called by BasePeer to determine whether the sql command specified by this criteria must be wrapped in a transaction. a boolean value



or
public Criteria or(Criterion c)(Code)
This method adds a prepared Criterion object to the Criteria. You can get a new, empty Criterion object with the getNewCriterion() method. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion. This is used as follows:

Criteria crit = new Criteria(); Criteria.Criterion c = crit.getNewCriterion(BasePeer.ID, new Integer(5), Criteria.LESS_THAN); crit.or(c);
Parameters:
  c - A Criterion object A modified Criteria object.




or
public Criteria or(String column, Object value)(Code)
This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion. This is used as follows:

Criteria crit = new Criteria().or("column", "value"); An EQUAL comparison is used for column and value. The name of the table must be used implicitly in the column name, so the Column name must be something like 'TABLE.id'. If you don't like this, you can use the or(table, column, value) method.
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An Object. A modified Criteria object.




or
public Criteria or(String column, Object value, SqlEnum comparison)(Code)
This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion. If is used as follow:

Criteria crit = new Criteria().or("column", "value" "Criterion.GREATER_THAN"); Any comparison can be used. The name of the table must be used implicitly in the column name, so the Column name must be something like 'TABLE.id'. If you don't like this, you can use the or(table, column, value) method.
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An Object.
Parameters:
  comparison - A String. A modified Criteria object.




or
public Criteria or(String table, String column, Object value)(Code)
This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion. If is used as follows:

Criteria crit = new Criteria().or("table", "column", "value"); An EQUAL comparison is used for column and value.
Parameters:
  table - Name of the table which contains the column
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An Object. A modified Criteria object.




or
public Criteria or(String table, String column, Object value, SqlEnum comparison)(Code)
This method adds a new criterion to the list of criterias. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion. If is used as follows:

Criteria crit = new Criteria().or("table", "column", "value", "Criterion.GREATER_THAN"); Any comparison can be used.
Parameters:
  table - Name of table which contains the column
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An Object.
Parameters:
  comparison - String describing how to compare the column with the value A modified Criteria object.




or
public Criteria or(String column, boolean value)(Code)
Convenience method to add a boolean to Criteria. Equal to

or(column, new Boolean(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A Boolean. A modified Criteria object.




or
public Criteria or(String column, boolean value, SqlEnum comparison)(Code)
Convenience method to add a boolean to Criteria. Equal to

or(column, new Boolean(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A Boolean.
Parameters:
  comparison - String describing how to compare the columnwith the value A modified Criteria object.




or
public Criteria or(String column, int value)(Code)
Convenience method to add an int to Criteria. Equal to

or(column, new Integer(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An int. A modified Criteria object.




or
public Criteria or(String column, int value, SqlEnum comparison)(Code)
Convenience method to add an int to Criteria. Equal to

or(column, new Integer(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - An int.
Parameters:
  comparison - String describing how to compare the columnwith the value A modified Criteria object.




or
public Criteria or(String column, long value)(Code)
Convenience method to add a long to Criteria. Equal to

or(column, new Long(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A long. A modified Criteria object.




or
public Criteria or(String column, long value, SqlEnum comparison)(Code)
Convenience method to add a long to Criteria. Equal to

or(column, new Long(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A long.
Parameters:
  comparison - String describing how to compare the columnwith the value A modified Criteria object.




or
public Criteria or(String column, float value)(Code)
Convenience method to add a float to Criteria. Equal to

or(column, new Float(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A float. A modified Criteria object.




or
public Criteria or(String column, float value, SqlEnum comparison)(Code)
Convenience method to add a float to Criteria. Equal to

or(column, new Float(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A float.
Parameters:
  comparison - String describing how to compare the columnwith the value A modified Criteria object.




or
public Criteria or(String column, double value)(Code)
Convenience method to add a double to Criteria. Equal to

or(column, new Double(value), EQUAL);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A double. A modified Criteria object.




or
public Criteria or(String column, double value, SqlEnum comparison)(Code)
Convenience method to add a double to Criteria. Equal to

or(column, new Double(value), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  value - A double.
Parameters:
  comparison - String describing how to compare the columnwith the value A modified Criteria object.




orDate
public Criteria orDate(String column, int year, int month, int date)(Code)
Convenience method to add a Date object specified by year, month, and date into the Criteria. Equal to

or(column, new GregorianCalendar(year, month,date), EQUAL);
Parameters:
  column - A String value to use as column.
Parameters:
  year - An int with the year.
Parameters:
  month - An int with the month.
Parameters:
  date - An int with the date. A modified Criteria object.




orDate
public Criteria orDate(String column, int year, int month, int date, SqlEnum comparison)(Code)
Convenience method to add a Date object specified by year, month, and date into the Criteria. Equal to

or(column, new GregorianCalendar(year, month,date), comparison);
Parameters:
  column - The column to run the comparison on
Parameters:
  year - An int with the year.
Parameters:
  month - An int with the month.
Parameters:
  date - An int with the date.
Parameters:
  comparison - String describing how to compare the columnwith the value A modified Criteria object.




orIn
public Criteria orIn(String column, Object[] values)(Code)
Adds an 'IN' clause with the criteria supplied as an Object array. For example:

FOO.NAME IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An Object[] with the allowed values. A modified Criteria object.




orIn
public Criteria orIn(String column, int[] values)(Code)
Adds an 'IN' clause with the criteria supplied as an int array. For example:

FOO.ID IN ('2', '3', '7')

where 'values' contains those three integers. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An int[] with the allowed values. A modified Criteria object.




orIn
public Criteria orIn(String column, List values)(Code)
Adds an 'IN' clause with the criteria supplied as a List. For example:

FOO.NAME IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - A List with the allowed values. A modified Criteria object.




orNotIn
public Criteria orNotIn(String column, Object[] values)(Code)
Adds a 'NOT IN' clause with the criteria supplied as an Object array. For example:

FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An Object[] with the disallowed values. A modified Criteria object.




orNotIn
public Criteria orNotIn(String column, int[] values)(Code)
Adds a 'NOT IN' clause with the criteria supplied as an int array. For example:

FOO.ID NOT IN ('2', '3', '7')

where 'values' contains those three integers. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - An int[] with the disallowed values. A modified Criteria object.




orNotIn
public Criteria orNotIn(String column, List values)(Code)
Adds a 'NOT IN' clause with the criteria supplied as a List. For example:

FOO.NAME NOT IN ('FOO', 'BAR', 'ZOW')

where 'values' contains three objects that evaluate to the respective strings above when .toString() is called. If a criterion for the requested column already exists, it is "OR"ed to the existing criterion.
Parameters:
  column - The column to run the comparison on
Parameters:
  values - A List with the disallowed values. A modified Criteria object.




put
public Object put(Object key, Object value)(Code)
Overrides Hashtable put, so that this object is returned instead of the value previously in the Criteria object. The reason is so that it more closely matches the behavior of the add() methods. If you want to get the previous value then you should first Criteria.get() it yourself. Note, if you attempt to pass in an Object that is not a String, it will throw a NPE. The reason for this is that none of the add() methods support adding anything other than a String as a key.
Parameters:
  key - An Object. Must be instanceof String!
Parameters:
  value - An Object.
throws:
  NullPointerException - if key != String or key/value is null. Instance of self.



putAll
public synchronized void putAll(Map t)(Code)
Copies all of the mappings from the specified Map to this Criteria These mappings will replace any mappings that this Criteria had for any of the keys currently in the specified Map. if the map was another Criteria, its attributes are copied to this Criteria, overwriting previous settings.
Parameters:
  t - Mappings to be stored in this map.



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



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



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



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



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



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



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



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



setSingleRecord
public Criteria setSingleRecord(boolean b)(Code)
Set single record? Set this to true if you expect the query to result in only a single result record (the default behaviour is to throw a TorqueException if multiple records are returned when the query is executed). This should be used in situations where returning multiple rows would indicate an error of some sort. If your query might return multiple records but you are only interested in the first one then you should be using setLimit(1).
Parameters:
  b - set to true if you expect the query to select justone record. A modified Criteria object.



setUseTransaction
public void setUseTransaction(boolean v)(Code)
Will force the sql represented by this criteria to be executed within a transaction. This is here primarily to support the oid type in postgresql. Though it can be used to require any single sql statement to use a transaction.



toString
public String toString()(Code)
Build a string representation of the Criteria. A String with the representation of the Criteria.



Methods inherited from java.util.Hashtable
public synchronized void clear()(Code)(Java Doc)
public synchronized Object clone()(Code)(Java Doc)
public synchronized boolean contains(Object value)(Code)(Java Doc)
public synchronized boolean containsKey(Object key)(Code)(Java Doc)
public boolean containsValue(Object value)(Code)(Java Doc)
public synchronized Enumeration<V> elements()(Code)(Java Doc)
public Set<Map.Entry<K, V>> entrySet()(Code)(Java Doc)
public synchronized boolean equals(Object o)(Code)(Java Doc)
public synchronized V get(Object key)(Code)(Java Doc)
public synchronized int hashCode()(Code)(Java Doc)
public synchronized boolean isEmpty()(Code)(Java Doc)
public Set<K> keySet()(Code)(Java Doc)
public synchronized Enumeration<K> keys()(Code)(Java Doc)
public synchronized V put(K key, V value)(Code)(Java Doc)
public synchronized void putAll(Map<? extends K, ? extends V> t)(Code)(Java Doc)
protected void rehash()(Code)(Java Doc)
public synchronized V remove(Object key)(Code)(Java Doc)
public synchronized int size()(Code)(Java Doc)
public synchronized String toString()(Code)(Java Doc)
public Collection<V> values()(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.