Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javatools.db
Class DbColumn  view DbColumn download DbColumn.java

java.lang.Object
  extended byjavatools.db.DbExpr
      extended byjavatools.db.DbColumn
All Implemented Interfaces:
DbTableUser

public class DbColumn
extends DbExpr

A class that represents a particular column within a particular DbTable. Based upon class DbColumn by Chris Bitmead.

Version:
0.0.1

Field Summary
(package private)  int index
          The position between the fields.
(package private)  DbAbstractTable table
          The indexed table.
 
Fields inherited from class javatools.db.DbExpr
db
 
Constructor Summary
DbColumn(DbAbstractTable table, int index)
          Creates a new DbColumn.
 
Method Summary
 boolean equals(java.lang.Object o)
          Checks if a column equals another column.
 int getIndex()
          Returns the index of the column among the fields of the table.
 java.lang.String getName()
          Returns the column name.
 java.lang.String getQueryString()
          Returns the query string related to this column.
 int getSize()
          Returns the display size of this column.
 DbExpr getSubExpr(DbColumn[] cols)
          Currently unused.
 int setSqlValues(java.sql.PreparedStatement ps, int i)
          Sets, in a prepared statement, the value related to this column, that will be used, e.g., in an INSERT operation.
 DbExpr substituteColumn(DbColumn oldCol, DbColumn newCol)
          Currently unused.
 java.lang.String toString()
          The fully qualified name of this column.
 void usesTables(java.util.Set c)
          Adds to the set, the currently indexed table.
 
Methods inherited from class javatools.db.DbExpr
and, containsAllStrings, containsAllStrings, count, dateTrunc, equal, getString, greaterThan, greaterThanOrEqual, in, in, isNotNull, isNull, lessThan, lessThanOrEqual, like, lower, max, min, notEqual, notIn, notIn, or, setSqlValue, upper, usesTables
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

table

DbAbstractTable table
The indexed table.


index

int index
The position between the fields.

Constructor Detail

DbColumn

public DbColumn(DbAbstractTable table,
                int index)
Creates a new DbColumn.

Method Detail

getQueryString

public java.lang.String getQueryString()
Returns the query string related to this column.

Specified by:
getQueryString in class DbExpr

getName

public java.lang.String getName()
Returns the column name.


setSqlValues

public int setSqlValues(java.sql.PreparedStatement ps,
                        int i)
                 throws DbException
Sets, in a prepared statement, the value related to this column, that will be used, e.g., in an INSERT operation. Anyway it is obscure...

Specified by:
setSqlValues in class DbExpr

getSize

public int getSize()
Returns the display size of this column.


getIndex

public int getIndex()
Returns the index of the column among the fields of the table.


equals

public boolean equals(java.lang.Object o)
Checks if a column equals another column.


toString

public java.lang.String toString()
The fully qualified name of this column.


usesTables

public void usesTables(java.util.Set c)
Adds to the set, the currently indexed table.

Specified by:
usesTables in interface DbTableUser
Overrides:
usesTables in class DbExpr

getSubExpr

public DbExpr getSubExpr(DbColumn[] cols)
                  throws DbException
Currently unused. It should take a sub-expression containing the specified columns.


substituteColumn

public DbExpr substituteColumn(DbColumn oldCol,
                               DbColumn newCol)
                        throws DbException
Currently unused. It should replace oldCol with newCol.