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

Quick Search    Search Deep

javatools.db
Class DbJoinedTable  view DbJoinedTable download DbJoinedTable.java

java.lang.Object
  extended byjavatools.db.AbstractTable
      extended byjavatools.db.DbAbstractTable
          extended byjavatools.db.DbJoinedTable
All Implemented Interfaces:
DbTableUser

public class DbJoinedTable
extends DbAbstractTable

This class represents a "joined table" in an SQL statement.

Version:
0.2.0

Field Summary
static int INNER_JOIN
          Represents an inner join.
private  DbExpr joinCondition
           
private  int joinType
           
static int LEFT_JOIN
          Represents a left join.
static int NATURAL_JOIN
          Represents a left join.
static int OUTER_JOIN
          Represents an outer join.
static int RIGHT_JOIN
          Represents a right join.
private  DbAbstractTable tableLeft
           
private  DbAbstractTable tableRight
           
 
Fields inherited from class javatools.db.DbAbstractTable
db
 
Fields inherited from class javatools.db.AbstractTable
colNameMap, displaySize, names, tableName, types
 
Constructor Summary
DbJoinedTable(DbDatabase db, DbAbstractTable tabLeft, DbAbstractTable tabRight, int pJoinType, DbExpr pJoinCondition)
          Creates a new instance of DbJoinedTable
 
Method Summary
private  void buildTableName()
           
 DbDeleter deleter()
          Returns a deleter for deleting rows in the database.
 boolean equals(java.lang.Object o)
          Check if an object is equal to the current one.
 DbColumn getColumn(int index)
          Get the column of the given index.
 DbColumn getColumn(java.lang.String name)
          Get the DbColumn representing the column with this name.
 int getColumnCount()
          Returns the number of columns
 DbConstraint getConstraint()
          Returns the DbConstraint object associated with this table.
 java.lang.Object getDefault(int index)
          Returns the default value for the field at the given index.
 java.lang.Object getDefault(java.lang.String name)
          Returns the default value for the field whose name is specified.
 DbInserter inserter()
          Return an inserter for inserting new data in the database.
 DbInserter inserter(DbSelector selector)
          Return an inserter for inserting new data in the database.
 void setTableName(java.lang.String v)
          Sets the name of the referenced table.
 DbDeleter simpleDeleter()
          Returns a deleter for deleting rows in the database.
 DbInserter simpleInserter()
          Return an inserter for inserting new data in the database.
 DbInserter simpleInserter(DbSelector selector)
          Return an inserter for inserting new data in the database.
 DbUpdater simpleUpdater()
          Return an updater for updating rows in the database.
 DbUpdater updater()
          Return an updater for updating rows in the database.
 void usesTables(java.util.Set c)
          Returns the base tables used in this joined table.
 
Methods inherited from class javatools.db.DbAbstractTable
getDatabase
 
Methods inherited from class javatools.db.AbstractTable
getColumnIndex, getColumnName, getFullTableName, setColumnCount, setColumnName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INNER_JOIN

public static final int INNER_JOIN
Represents an inner join.

See Also:
Constant Field Values

NATURAL_JOIN

public static final int NATURAL_JOIN
Represents a left join.

See Also:
Constant Field Values

LEFT_JOIN

public static final int LEFT_JOIN
Represents a left join.

See Also:
Constant Field Values

RIGHT_JOIN

public static final int RIGHT_JOIN
Represents a right join.

See Also:
Constant Field Values

OUTER_JOIN

public static final int OUTER_JOIN
Represents an outer join.

See Also:
Constant Field Values

tableLeft

private DbAbstractTable tableLeft

tableRight

private DbAbstractTable tableRight

joinType

private int joinType

joinCondition

private DbExpr joinCondition
Constructor Detail

DbJoinedTable

public DbJoinedTable(DbDatabase db,
                     DbAbstractTable tabLeft,
                     DbAbstractTable tabRight,
                     int pJoinType,
                     DbExpr pJoinCondition)
              throws DbException
Creates a new instance of DbJoinedTable

Method Detail

getDefault

public java.lang.Object getDefault(int index)
                            throws DbException
Returns the default value for the field at the given index.

Specified by:
getDefault in class DbAbstractTable

equals

public boolean equals(java.lang.Object o)
Check if an object is equal to the current one.

Overrides:
equals in class AbstractTable

getDefault

public java.lang.Object getDefault(java.lang.String name)
                            throws DbException
Returns the default value for the field whose name is specified.

Specified by:
getDefault in class DbAbstractTable

getColumn

public DbColumn getColumn(java.lang.String name)
                   throws DbException
Get the DbColumn representing the column with this name.

Specified by:
getColumn in class DbAbstractTable

getColumnCount

public int getColumnCount()
Returns the number of columns

Overrides:
getColumnCount in class AbstractTable

deleter

public DbDeleter deleter()
                  throws DbException
Returns a deleter for deleting rows in the database. This deleter takes care of constraints.

Overrides:
deleter in class DbAbstractTable

getConstraint

public DbConstraint getConstraint()
Returns the DbConstraint object associated with this table.

Specified by:
getConstraint in class DbAbstractTable

getColumn

public DbColumn getColumn(int index)
                   throws DbException
Get the column of the given index. Index is a zero based array.

Specified by:
getColumn in class DbAbstractTable

inserter

public DbInserter inserter()
                    throws DbException
Return an inserter for inserting new data in the database. This method is for SQL of the form INSERT INTO table(...) VALUES(...) This inserter takes care of constraints.

Overrides:
inserter in class DbAbstractTable

inserter

public DbInserter inserter(DbSelector selector)
                    throws DbException
Return an inserter for inserting new data in the database. This method is for SQL of the form INSERT INTO table(...) SELECT ... This inserter takes care of constraints.

Overrides:
inserter in class DbAbstractTable

setTableName

public void setTableName(java.lang.String v)
Sets the name of the referenced table.

Overrides:
setTableName in class AbstractTable

simpleDeleter

public DbDeleter simpleDeleter()
                        throws DbException
Returns a deleter for deleting rows in the database. This deleter takes care of constraints.

Overrides:
simpleDeleter in class DbAbstractTable

simpleInserter

public DbInserter simpleInserter()
                          throws DbException
Return an inserter for inserting new data in the database. This method is for SQL of the form INSERT INTO table(...) SELECT ... This inserter DOES NOT take care of constraints.

Overrides:
simpleInserter in class DbAbstractTable

simpleInserter

public DbInserter simpleInserter(DbSelector selector)
                          throws DbException
Return an inserter for inserting new data in the database. This method is for SQL of the form INSERT INTO table(...) SELECT ... This inserter DOES NOT take care of constraints.

Overrides:
simpleInserter in class DbAbstractTable

simpleUpdater

public DbUpdater simpleUpdater()
                        throws DbException
Return an updater for updating rows in the database. This updater DOES NOT take care of constraints.

Overrides:
simpleUpdater in class DbAbstractTable

updater

public DbUpdater updater()
                  throws DbException
Return an updater for updating rows in the database. This updater takes care of constraints.

Overrides:
updater in class DbAbstractTable

usesTables

public void usesTables(java.util.Set c)
Returns the base tables used in this joined table.

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

buildTableName

private void buildTableName()
                     throws DbException