javatools.db
Class DbParenthesis

java.lang.Object
  |
  +--javatools.db.DbExpr
        |
        +--javatools.db.DbParenthesis
All Implemented Interfaces:
DbTableUser

public class DbParenthesis
extends DbExpr

This expression has the result of putting parenthesis around another expression. i.e. "expr" becomes "( expr )". It should be noted that you won't usually use this class in your application code. Normally the order of evaluation of the SQL is implied by the parethesis in your Java code. i.e.

 DbExpr x = a.and((b.or(c)).and(d))
 
This will automatically retain the Java evaluation order...
 A AND ( (B OR C) AND D)
 


Constructor Summary
DbParenthesis(DbDatabase db, DbExpr expr)
          Constructor for the DbParenthesis object
 
Method Summary
 java.lang.String getQueryString()
          Gets the queryString attribute of the DbParenthesis object
 int setSqlValues(java.sql.PreparedStatement ps, int i)
          Sets the sqlValues attribute of the DbParenthesis object
 void usesTables(java.util.Set c)
          Puts in the passed set all used tables 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

DbParenthesis

public DbParenthesis(DbDatabase db,
                     DbExpr expr)
Constructor for the DbParenthesis object

Parameters:
db - The database that will be used.
expr - The expression to be put in parenthesis.
Method Detail

setSqlValues

public int setSqlValues(java.sql.PreparedStatement ps,
                        int i)
                 throws java.sql.SQLException,
                        DbException
Sets the sqlValues attribute of the DbParenthesis object

Specified by:
setSqlValues in class DbExpr
Parameters:
ps - The statement.
i - The new sqlValues value
Returns:
Description of the Returned Value
Throws:
java.sql.SQLException - If something goes wrong.
DbException - If something goes wrong.

getQueryString

public java.lang.String getQueryString()
                                throws DbException
Gets the queryString attribute of the DbParenthesis object

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

usesTables

public void usesTables(java.util.Set c)
Puts in the passed set all used tables by this expression.

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