|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javatools.db.DbAbstractTable
A class representing tabular data. Could be a real database table or the result of a SELECT. Based upon class DbTable written by Chris Bitmead, of which it is an abstraction to differentiate between real tables and results of a SELECT command.
Field Summary | |
protected DbDatabase |
db
The database used for the connection. |
protected int[] |
displaySize
This array contains the display size for each field. |
protected java.lang.String[] |
names
This array contains the names of the fields of the table. |
protected java.lang.String |
tableName
The name of used table |
protected int[] |
types
This array contains the SQL types for each field. |
Constructor Summary | |
DbAbstractTable(DbDatabase db)
Constructor. |
Method Summary | |
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. |
abstract DbColumn |
getColumn(int index)
Get the column of the given index. |
abstract DbColumn |
getColumn(java.lang.String name)
Get the DbColumn representing the column with this name. |
abstract int |
getColumnCount()
Returns the number of columns |
abstract DbConstraint |
getConstraint()
Returns the DbConstraint object associated with this table. |
DbDatabase |
getDatabase()
Get the database that this table came from |
abstract java.lang.Object |
getDefault(int index)
Returns the default value for the field at the given index. |
abstract java.lang.Object |
getDefault(java.lang.String name)
Returns the default value for the field whose name is specified. |
java.lang.String |
getFullTableName()
Returns the complete table name. |
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 used tables (useful in joined tables). |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected DbDatabase db
protected java.lang.String tableName
protected java.lang.String[] names
protected int[] displaySize
protected int[] types
Constructor Detail |
public DbAbstractTable(DbDatabase db) throws DbException
db
- The database to be used
DbException
- If something goes wrong.Method Detail |
public void setTableName(java.lang.String v)
v
- The table name.public abstract DbColumn getColumn(java.lang.String name) throws DbException
name
- The name of tjhe needed column
DbException
- If something goes wrong.public abstract DbColumn getColumn(int index) throws DbException
index
- The position of the needed column.
DbException
- If something goes wrong.public abstract int getColumnCount()
public abstract DbConstraint getConstraint()
public abstract java.lang.Object getDefault(int index) throws DbException
index
- The field index.
DbException
- If something goes wrong.public abstract java.lang.Object getDefault(java.lang.String name) throws DbException
name
- The name of the needed field.
DbException
- If something goes wrong.public DbDatabase getDatabase()
public java.lang.String getFullTableName()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- The object to be compared.
true
: if these object are equal;
false
: otherwise.public DbInserter inserter(DbSelector selector) throws DbException
selector
- The selector to create the DbInserter object.
DbException
- If something goes wrong.public DbInserter simpleInserter(DbSelector selector) throws DbException
selector
- The selector to create the DbInserter object.
DbException
- If something goes wrong.public DbInserter inserter() throws DbException
DbException
- If something goes wrong.public DbInserter simpleInserter() throws DbException
DbException
- If something goes wrong.public DbUpdater updater() throws DbException
DbException
- If something goes wrong.public DbUpdater simpleUpdater() throws DbException
DbException
- If something goes wrong.public DbDeleter deleter() throws DbException
DbException
- If something goes wrong.public DbDeleter simpleDeleter() throws DbException
DbException
- If something goes wrong.public void usesTables(java.util.Set c)
usesTables
in interface DbTableUser
c
- The set to put used tables into.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |