org.apache.torque.util
Class Criteria.Criterion

java.lang.Object
  extended byorg.apache.torque.util.Criteria.Criterion
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
Criteria

public final class Criteria.Criterion
extends java.lang.Object
implements java.io.Serializable

This is an inner class that describes an object in the criteria.

See Also:
Serialized Form

Field Summary
static java.lang.String AND
           
private  java.util.List clauses
          other connected criteria and their conjunctions.
private  java.lang.String column
          Column name.
private  SqlEnum comparison
          Comparison value.
private  java.util.List conjunctions
           
private  DB db
          The DB adaptor which might be used to get db specific variations of sql.
private  boolean ignoreStringCase
          flag to ignore case in comparision
static java.lang.String OR
           
private  java.lang.String table
          Table name.
private  java.lang.Object value
          Value of the CO.
 
Constructor Summary
private Criteria.Criterion(java.lang.Object val, SqlEnum comp)
          Creates a new instance, initializing a couple members.
(package private) Criteria.Criterion(java.lang.String tableColumn, java.lang.Object val)
          Create a new instance.
(package private) Criteria.Criterion(java.lang.String tableColumn, java.lang.Object val, SqlEnum comp)
          Create a new instance.
(package private) Criteria.Criterion(java.lang.String table, java.lang.String column, java.lang.Object val)
          Create a new instance.
(package private) Criteria.Criterion(java.lang.String table, java.lang.String column, java.lang.Object val, SqlEnum comp)
          Create a new instance.
 
Method Summary
private  void addCriterionTable(Criteria.Criterion c, org.apache.commons.collections.StringStack s)
          method supporting recursion through all criterions to give us a StringStack of tables from each criterion
 Criteria.Criterion and(Criteria.Criterion criterion)
          Append an AND Criterion onto this Criterion's list.
 void appendPsTo(java.lang.StringBuffer sb, java.util.List params)
          Appends a Prepared Statement representation of the Criterion onto the buffer.
 void appendTo(java.lang.StringBuffer sb)
          Appends a representation of the Criterion onto the buffer.
 boolean equals(java.lang.Object obj)
          This method checks another Criteria to see if they contain the same attributes and hashtable entries.
 java.lang.String[] getAllTables()
          get all tables from nested criterion objects
 Criteria.Criterion[] getAttachedCriterion()
          get an array of all criterion attached to this recursing through all sub criterion
private  java.util.List getClauses()
          get the list of clauses in this Criterion
 java.lang.String getColumn()
          Get the column name.
 SqlEnum getComparison()
          Get the comparison.
private  java.util.List getConjunctions()
          get the list of conjunctions in this Criterion
 DB getDb()
          Get the value of db.
 java.lang.String getTable()
          Get the table name.
 java.lang.Object getValue()
          Get the value.
 int hashCode()
          Returns a hash code value for the object.
 boolean isIgnoreCase()
          Is ignore case on or off?
 Criteria.Criterion or(Criteria.Criterion criterion)
          Append an OR Criterion onto this Criterion's list.
 void setDB(DB v)
          Set the value of db.
 Criteria.Criterion setIgnoreCase(boolean b)
          Sets ignore case.
 void setTable(java.lang.String name)
          Set the table name.
 java.lang.String toString()
          Build a string representation of the Criterion.
private  void traverseCriterion(Criteria.Criterion c, java.util.ArrayList a)
          method supporting recursion through all criterions to give us an ArrayList of them
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

AND

public static final java.lang.String AND
See Also:
Constant Field Values

OR

public static final java.lang.String OR
See Also:
Constant Field Values

value

private java.lang.Object value
Value of the CO.


comparison

private SqlEnum comparison
Comparison value.


table

private java.lang.String table
Table name.


column

private java.lang.String column
Column name.


ignoreStringCase

private boolean ignoreStringCase
flag to ignore case in comparision


db

private DB db
The DB adaptor which might be used to get db specific variations of sql.


clauses

private java.util.List clauses
other connected criteria and their conjunctions.


conjunctions

private java.util.List conjunctions
Constructor Detail

Criteria.Criterion

private Criteria.Criterion(java.lang.Object val,
                           SqlEnum comp)
Creates a new instance, initializing a couple members.


Criteria.Criterion

Criteria.Criterion(java.lang.String table,
                   java.lang.String column,
                   java.lang.Object val,
                   SqlEnum comp)
Create a new instance.

Parameters:
table - A String with the name of the table.
column - A String with the name of the column.
val - An Object with the value for the Criteria.
comp - A String with the comparison value.

Criteria.Criterion

Criteria.Criterion(java.lang.String tableColumn,
                   java.lang.Object val,
                   SqlEnum comp)
Create a new instance.

Parameters:
tableColumn - A String with the full name of the column.
val - An Object with the value for the Criteria.
comp - A String with the comparison value.

Criteria.Criterion

Criteria.Criterion(java.lang.String table,
                   java.lang.String column,
                   java.lang.Object val)
Create a new instance.

Parameters:
table - A String with the name of the table.
column - A String with the name of the column.
val - An Object with the value for the Criteria.

Criteria.Criterion

Criteria.Criterion(java.lang.String tableColumn,
                   java.lang.Object val)
Create a new instance.

Parameters:
tableColumn - A String with the full name of the column.
val - An Object with the value for the Criteria.
Method Detail

getColumn

public java.lang.String getColumn()
Get the column name.

Returns:
A String with the column name.

setTable

public void setTable(java.lang.String name)
Set the table name.

Parameters:
name - A String with the table name.

getTable

public java.lang.String getTable()
Get the table name.

Returns:
A String with the table name.

getComparison

public SqlEnum getComparison()
Get the comparison.

Returns:
A String with the comparison.

getValue

public java.lang.Object getValue()
Get the value.

Returns:
An Object with the value.

getDb

public DB getDb()
Get the value of db. The DB adaptor which might be used to get db specific variations of sql.

Returns:
value of db.

setDB

public void setDB(DB v)
Set the value of db. The DB adaptor might be used to get db specific variations of sql.

Parameters:
v - Value to assign to db.

setIgnoreCase

public Criteria.Criterion setIgnoreCase(boolean b)
Sets ignore case.

Parameters:
b - True if case should be ignored.
Returns:
A modified Criteria object.

isIgnoreCase

public boolean isIgnoreCase()
Is ignore case on or off?

Returns:
True if case is ignored.

getClauses

private java.util.List getClauses()
get the list of clauses in this Criterion


getConjunctions

private java.util.List getConjunctions()
get the list of conjunctions in this Criterion


and

public Criteria.Criterion and(Criteria.Criterion criterion)
Append an AND Criterion onto this Criterion's list.


or

public Criteria.Criterion or(Criteria.Criterion criterion)
Append an OR Criterion onto this Criterion's list.


appendTo

public void appendTo(java.lang.StringBuffer sb)
Appends a representation of the Criterion onto the buffer.


appendPsTo

public void appendPsTo(java.lang.StringBuffer sb,
                       java.util.List params)
Appends a Prepared Statement representation of the Criterion onto the buffer.

Parameters:
sb - The stringbuffer that will receive the Prepared Statement
params - A list to which Prepared Statement parameters will be appended

toString

public java.lang.String toString()
Build a string representation of the Criterion.

Returns:
A String with the representation of the Criterion.

equals

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


hashCode

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


getAllTables

public java.lang.String[] getAllTables()
get all tables from nested criterion objects


addCriterionTable

private void addCriterionTable(Criteria.Criterion c,
                               org.apache.commons.collections.StringStack s)
method supporting recursion through all criterions to give us a StringStack of tables from each criterion


getAttachedCriterion

public Criteria.Criterion[] getAttachedCriterion()
get an array of all criterion attached to this recursing through all sub criterion


traverseCriterion

private void traverseCriterion(Criteria.Criterion c,
                               java.util.ArrayList a)
method supporting recursion through all criterions to give us an ArrayList of them



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