org.apache.ws.jaxme.sqls.impl

Class ViewImpl

Implemented Interfaces:
Table

public class ViewImpl
extends TableImpl

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.ws.jaxme.sqls.impl.TableImpl

TableImpl.NameImpl

Constructor Summary

ViewImpl(SelectStatement pSelectStatement, Table.Name pName)

Method Summary

Column
getColumn(Column.Name pName)
Returns the column with the given name or null, if no such column exists.
Iterator
getColumns()
Returns the table columns.
DeleteStatement
getDeleteStatement()
Returns an UPDATE statement for updating a column in the table.
Iterator
getForeignKeys()
Returns an Iterator to the foreign keys defined on the table.
Iterator
getIndexes()
Returns an Iterator to the indexes defined on the table.
InsertStatement
getInsertStatement()
Returns an INSERT statement for filling all the values.
Index
getPrimaryKey()
Returns the tables primary key, if any, or null, if the table doesn't have a primary key.
UpdateStatement
getUpdateStatement()
Returns an UPDATE statement for updating a column in the table.
SelectStatement
getViewStatement()
Column
newColumn(String pName, Column.Type pType)
Creates a new column.
Column
newColumn(Column.Name pName, Column.Type pType)
Creates a new column.
ForeignKey
newForeignKey(Table pReferencedTable)
Creates a new foreign key referencing the given table.
Index
newIndex()
Creates a new, non-unique index on the table.
Index
newKey()
Creates a new, unique index on the table.
Index
newPrimaryKey()
Creates a new primary key on the table.

Methods inherited from class org.apache.ws.jaxme.sqls.impl.TableImpl

equals, getColumn, getColumn, getColumns, getDeleteStatement, getForeignKeys, getIndexes, getInsertStatement, getName, getPrimaryKey, getQName, getSchema, getSelectStatement, getUpdateStatement, hashCode, newColumn, newColumn, newForeignKey, newIndex, newKey, newPrimaryKey

Constructor Details

ViewImpl

protected ViewImpl(SelectStatement pSelectStatement,
                   Table.Name pName)

Method Details

getColumn

public Column getColumn(Column.Name pName)
Returns the column with the given name or null, if no such column exists.
Specified by:
getColumn in interface Table
Overrides:
getColumn in interface TableImpl

getColumns

public Iterator getColumns()
Returns the table columns.
Specified by:
getColumns in interface Table
Overrides:
getColumns in interface TableImpl

getDeleteStatement

public DeleteStatement getDeleteStatement()
Returns an UPDATE statement for updating a column in the table. In other words: If the table FOO has the primary key columns A and B, then the statement DELETE FROM FOO WHERE A = ? AND B = ? will be returned.
Specified by:
getDeleteStatement in interface Table
Overrides:
getDeleteStatement in interface TableImpl

getForeignKeys

public Iterator getForeignKeys()
Returns an Iterator to the foreign keys defined on the table.
Specified by:
getForeignKeys in interface Table
Overrides:
getForeignKeys in interface TableImpl

getIndexes

public Iterator getIndexes()
Returns an Iterator to the indexes defined on the table. This iterator includes the primary key, if any.
Specified by:
getIndexes in interface Table
Overrides:
getIndexes in interface TableImpl

getInsertStatement

public InsertStatement getInsertStatement()
Returns an INSERT statement for filling all the values. In other words: If the table FOO has the columns A, B, and C, then the statement INSERT INTO FOO (A,B,C) VALUES (?, ?, ?) will be returned.
Specified by:
getInsertStatement in interface Table
Overrides:
getInsertStatement in interface TableImpl

getPrimaryKey

public Index getPrimaryKey()
Returns the tables primary key, if any, or null, if the table doesn't have a primary key.
Specified by:
getPrimaryKey in interface Table
Overrides:
getPrimaryKey in interface TableImpl

getUpdateStatement

public UpdateStatement getUpdateStatement()
Returns an UPDATE statement for updating a column in the table. In other words: If the table FOO has the columns A, B, C and D with the primary key columns A and B, then the statement UPDATE FOO SET C = ?, D = ? WHERE A = ? AND B = ? will be returned.
Specified by:
getUpdateStatement in interface Table
Overrides:
getUpdateStatement in interface TableImpl

getViewStatement

public SelectStatement getViewStatement()

newColumn

public Column newColumn(String pName,
                        Column.Type pType)
Creates a new column.
Specified by:
newColumn in interface Table
Overrides:
newColumn in interface TableImpl

newColumn

public Column newColumn(Column.Name pName,
                        Column.Type pType)
Creates a new column.
Specified by:
newColumn in interface Table
Overrides:
newColumn in interface TableImpl

newForeignKey

public ForeignKey newForeignKey(Table pReferencedTable)
Creates a new foreign key referencing the given table.
Specified by:
newForeignKey in interface Table
Overrides:
newForeignKey in interface TableImpl

newIndex

public Index newIndex()
Creates a new, non-unique index on the table.
Specified by:
newIndex in interface Table
Overrides:
newIndex in interface TableImpl

newKey

public Index newKey()
Creates a new, unique index on the table.
Specified by:
newKey in interface Table
Overrides:
newKey in interface TableImpl

newPrimaryKey

public Index newPrimaryKey()
Creates a new primary key on the table.
Specified by:
newPrimaryKey in interface Table
Overrides:
newPrimaryKey in interface TableImpl