|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--ModSQL.SelectTable
Wrapper for a Select object to make it look like a DatabaseTable. This class is used when a SELECT statement appears as a subquery in the FROM section of some other SELECT statement.
Select| Field Summary | |
private boolean |
afterlast
Are we after the last row? |
private boolean |
beforefirst
Are we before the first row? |
private String |
name
Name of table. |
private Table |
query
Query that generated the table. |
private long |
rownum
Current row number. |
| Constructor Summary | |
SelectTable(Table query,
String name)
Query should already be optimized before using this constructor. |
|
| Method Summary | |
boolean |
absolute(Object id)
Move to an absolute rowid in the table. |
void |
addColumn(String name,
int type,
int maxlen)
Add a new column. |
void |
addRow()
Add a new row. |
void |
afterLast()
Set current row to after last row in table. |
void |
beforeFirst()
Reset current row to before the first row in table. |
void |
close()
Close the query. |
void |
commitUpdates()
Commit column updates. |
void |
deleteRow()
Delete current row. |
protected void |
finalize()
Close table. |
int |
findColumn(String name)
Find a column with the specified name. |
int |
getColumnCount()
Number of columns in table. |
int |
getColumnDisplaySize(int column)
Get maximum size of column. |
String |
getColumnLabel(int column)
Get column label. |
String |
getColumnName(int column)
Get name of column. |
int |
getColumnType(int column)
Get column type. |
Object |
getObject(int column)
Get the value of a column in the current row as a Java object. |
long |
getRowCount()
Number of rows. |
Object |
getRowId()
Returns the rowid for the current row. |
String |
getTableName()
Name of table. |
long |
getTableSignature()
Table signature. |
long |
getTableSize()
Size of table in bytes. |
boolean |
isAfterLast()
Are we after the last row? |
boolean |
isBeforeFirst()
Are we before the first row? |
boolean |
isIndexAvailable(int column)
Is an index available? Indices are not supported for tables generated from a query so this method just returns null. |
boolean |
isReadOnly()
Is table readonly? |
boolean |
next()
Advance to next row in table. |
DatabaseIndex |
openIndex(int column)
Open an index on the table. |
String |
toString()
Human readable description of table. |
void |
updateObject(int column,
Object x)
Update value of column. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private Table query
private String name
private boolean beforefirst
private boolean afterlast
private long rownum
| Constructor Detail |
public SelectTable(Table query,
String name)
query - optimized query to generate tablename - name of table| Method Detail |
protected void finalize()
finalize in class Objectpublic final void close()
close in interface DatabaseTableBaseModSQL.DatabaseTableBaseDatabaseException - if a database-access error occurspublic DatabaseIndex openIndex(int column)
openIndex in interface DatabaseTablecolumn - open index for desired columnpublic boolean isIndexAvailable(int column)
isIndexAvailable in interface DatabaseTablecolumn - desired indexpublic boolean isReadOnly()
isReadOnly in interface DatabaseTablepublic long getTableSize()
getTableSize in interface DatabaseTablepublic long getTableSignature()
getTableSignature in interface DatabaseTablepublic String getTableName()
getTableName in interface DatabaseTable
public int getColumnCount()
throws DatabaseException
getColumnCount in interface DatabaseTableDatabaseException - is the query failspublic long getRowCount()
getRowCount in interface DatabaseTableBasepublic String toString()
toString in class Object
public int findColumn(String name)
throws DatabaseException
findColumn in interface DatabaseTablename - name of column to findDatabaseException - if there is a problem with the query
public String getColumnName(int column)
throws DatabaseException
getColumnName in interface DatabaseTablecolumn - index of columnDatabaseException - if there is a problem with the query
public String getColumnLabel(int column)
throws DatabaseException
getColumnLabel in interface DatabaseTablecolumn - index of columnDatabaseException - if there is a problem with the query
public int getColumnType(int column)
throws DatabaseException
getColumnType in interface DatabaseTablecolumn - index of columnDatabaseException - if there is a problem with the query
public int getColumnDisplaySize(int column)
throws DatabaseException
getColumnDisplaySize in interface DatabaseTablecolumn - index of columnDatabaseException - if there is a problem with the query
public void addColumn(String name,
int type,
int maxlen)
throws DatabaseException
addColumn in interface DatabaseTableDatabaseException - always since table is read-only
public boolean next()
throws DatabaseException
next in interface DatabaseTableBaseDatabaseException - if there is a problem with the query
public void deleteRow()
throws DatabaseException
deleteRow in interface DatabaseTableBaseDatabaseException - always since table is read-only
public void addRow()
throws DatabaseException
addRow in interface DatabaseTableDatabaseException - always since table is read-onlypublic boolean isBeforeFirst()
isBeforeFirst in interface DatabaseTableBasepublic boolean isAfterLast()
isAfterLast in interface DatabaseTableBase
public void beforeFirst()
throws DatabaseException
beforeFirst in interface DatabaseTableBaseDatabaseException - if there is a problem with the querypublic void afterLast()
afterLast in interface DatabaseTableBaseModSQL.DatabaseTableBaseDatabaseException - if a database-access error occurspublic Object getRowId()
getRowId in interface DatabaseTableBase
public boolean absolute(Object id)
throws DatabaseException
absolute in interface DatabaseTablerowid - id of row to seekDatabaseException - always since this method is not supported
public Object getObject(int column)
throws DatabaseException
getObject in interface DatabaseTableBasecolumn - index of columnDatabaseException - if there is a problem with the query
public void updateObject(int column,
Object x)
throws DatabaseException
updateObject in interface DatabaseTableBasecolumn - index of column to updatex - new column valueDatabaseException - always since table is read-only
public void commitUpdates()
throws DatabaseException
commitUpdates in interface DatabaseTableBaseDatabaseException - always since table is read-only
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||