javatools.db
Class DbCriterion

java.lang.Object
  |
  +--javatools.db.DbExpr
        |
        +--javatools.db.DbCriterion
All Implemented Interfaces:
DbTableUser
Direct Known Subclasses:
DbAndExpr, DbFalseExpr, DbOrExpr, DbTrueExpr

public class DbCriterion
extends DbExpr

It is a class that represents an expression of the type "A op B", where "op" is a generic operator.


Constructor Summary
DbCriterion(DbDatabase db, java.lang.Object c1, java.lang.String op, java.lang.Object c2)
          Builds a new DbCriterion object.
 
Method Summary
 java.lang.String getQueryString()
          Returns the query string related to this expression.
 int setSqlValues(java.sql.PreparedStatement ps, int i)
          Sets the real values in the passed statement.
 void usesTables(java.util.Set c)
          Adds to the passed set, the tables used by this expression.
 
Methods inherited from class javatools.db.DbExpr
and, containsAllStrings, containsAllStrings, count, dateTrunc, equal, greaterThan, greaterThanOrEqual, in, in, isNotNull, isNull, lessThan, lessThanOrEqual, like, lower, max, min, notEqual, notIn, notIn, or, upper, usesTables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbCriterion

public DbCriterion(DbDatabase db,
                   java.lang.Object c1,
                   java.lang.String op,
                   java.lang.Object c2)
Builds a new DbCriterion object.

Parameters:
db - The database for this operation.
c1 - The first term.
op - The operator.
c2 - The second term.
Method Detail

getQueryString

public java.lang.String getQueryString()
                                throws DbException
Returns the query string related to this expression.

Specified by:
getQueryString in class DbExpr
Returns:
The requested string.
Throws:
DbException - If something goes wrong.

setSqlValues

public int setSqlValues(java.sql.PreparedStatement ps,
                        int i)
                 throws DbException,
                        java.sql.SQLException
Sets the real values in the passed statement. Anyway it is an obscure method, call Chris Bitmead.

Specified by:
setSqlValues in class DbExpr
Parameters:
ps - The statement to put data into.
i - An index.
Returns:
An index.
Throws:
DbException - If something goes wrong.
java.sql.SQLException - If something goes wrong.

usesTables

public void usesTables(java.util.Set c)
Adds to the passed set, the tables used by this expression.

Specified by:
usesTables in interface DbTableUser
Overrides:
usesTables in class DbExpr
Parameters:
c - The set to add tables to.