|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.workingdogs.village.Schema
The Schema object represents the Columns in a database table. It contains a collection of Column objects.
Field Summary | |
private Column[] |
columns
|
private java.lang.String |
columnsAttribute
|
private int |
numberOfColumns
|
private static java.util.Hashtable |
schemaCache
|
private boolean |
singleTable
|
private java.util.Hashtable |
tableHash
This attribute is used to complement columns in the event that this schema represents more than one table. |
private java.lang.String |
tableName
|
Constructor Summary | |
Schema()
A blank Schema object |
Method Summary | |
(package private) void |
appendTableName(java.lang.String app)
Appends data to the tableName that this schema was first created with. |
java.lang.String |
attributes()
List of columns to select from the table |
Column |
column(int i)
Returns the requested Column object at index i |
Column |
column(java.lang.String colName)
Returns the requested Column object by name |
java.lang.String[] |
getAllTableNames()
returns all table names that this Schema represents |
Column |
getColumn(java.lang.String colName)
Returns the requested Column object by name |
Column |
getColumn(java.lang.String tableName,
java.lang.String colName)
Returns the requested Column object belonging to the specified table by name |
(package private) Column[] |
getColumns()
Returns an array of columns |
java.lang.String |
getTableName()
returns the table name that this Schema represents |
int |
index(java.lang.String colName)
Gets the index position of a named column. |
int |
index(java.lang.String tableName,
java.lang.String colName)
Gets the index position of a named column. |
boolean |
isSingleTable()
Checks to see if this DataSet represents one table in the database. |
int |
numberOfColumns()
Gets the number of columns in this Schema |
(package private) void |
populate(java.sql.ResultSetMetaData meta,
java.lang.String tableName)
Internal method which populates this Schema object with Columns. |
Schema |
schema(java.sql.Connection conn,
java.lang.String tableName)
Creates a Schema with all columns |
Schema |
schema(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String columnsAttribute)
Creates a Schema with the named columns in the columnsAttribute |
(package private) void |
setAttributes(java.lang.String attributes)
Sets the columns to select from the table |
(package private) void |
setTableName(java.lang.String tableName)
Sets the table name that this Schema represents |
java.lang.String |
tableName()
returns the table name that this Schema represents |
java.lang.String |
toString()
This returns a representation of this Schema |
Methods inherited from class java.lang.Object |
|
Field Detail |
private java.lang.String tableName
private java.lang.String columnsAttribute
private int numberOfColumns
private Column[] columns
private static java.util.Hashtable schemaCache
private java.util.Hashtable tableHash
private boolean singleTable
Constructor Detail |
public Schema()
Method Detail |
public Schema schema(java.sql.Connection conn, java.lang.String tableName) throws java.sql.SQLException, DataSetException
conn
- tableName
- java.sql.SQLException
- DataSetException
- public Schema schema(java.sql.Connection conn, java.lang.String tableName, java.lang.String columnsAttribute) throws java.sql.SQLException, DataSetException
conn
- tableName
- columnsAttribute
- java.sql.SQLException
- DataSetException
- void appendTableName(java.lang.String app)
app
- String to append to tableNameTableDataSet.tableQualifier(java.lang.String)
public java.lang.String attributes()
public Column column(int i) throws DataSetException
i
- DataSetException
- public Column column(java.lang.String colName) throws DataSetException
colName
- DataSetException
- public Column getColumn(java.lang.String colName) throws DataSetException
colName
- DataSetException
- public Column getColumn(java.lang.String tableName, java.lang.String colName) throws DataSetException
tableName
- colName
- DataSetException
- Column[] getColumns()
public java.lang.String getTableName() throws DataSetException
public java.lang.String[] getAllTableNames()
public int index(java.lang.String colName) throws DataSetException
colName
- DataSetException
- public int index(java.lang.String tableName, java.lang.String colName) throws DataSetException
tableName
- colName
- DataSetException
- public boolean isSingleTable()
public int numberOfColumns()
void populate(java.sql.ResultSetMetaData meta, java.lang.String tableName) throws java.sql.SQLException, DataSetException
meta
- The meta data of the ResultSet used to build this
Schema.tableName
- The name of the table referenced in this schema, or
null if unknown or multiple tables are involved.java.sql.SQLException
- DataSetException
- void setAttributes(java.lang.String attributes)
attributes
- comma separated list of column namesvoid setTableName(java.lang.String tableName)
tableName
- public java.lang.String tableName() throws DataSetException
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |