Dresden OCL Toolkit

tudresden.ocl.codegen.decl
Class View

java.lang.Object
  extended bytudresden.ocl.codegen.decl.Table
      extended bytudresden.ocl.codegen.decl.View

public class View
extends Table

A virtual table, which contains rows defined by an SQL Select statement in terms of other tables. The class is a direct subclass of the Table class and therefore provides the full range of functionality of a Table including foreign key and primary key handling. Additionally, the table names and the SQL Statement can be stored in a View object.

Author:
Sten Loecher

Nested Class Summary
 
Nested classes inherited from class tudresden.ocl.codegen.decl.Table
 
Field Summary
private  String description
          A description of the view object.
private  String statement
          The SQL statement.
private  List tableNames
          A List that contains all table names, which are used to specify the SQL statement.
 
Fields inherited from class tudresden.ocl.codegen.decl.Table
 
Constructor Summary
View(String name)
           
View(String name, String statement, List tableNames, String description)
           
 
Method Summary
 String getDescription()
           
 String getStatement()
           
 List getTableNames()
           
 void setStatement(String statement)
           
 void setTableNames(List tableNames)
           
 String toString()
           
 
Methods inherited from class tudresden.ocl.codegen.decl.Table
addColumn, addColumn, addColumn, addColumn, addReferringTable, attributes, getAllForeignKeyColumns, getAttributeColumn, getAttributeColumns, getColumnAttribute, getColumns, getColumnType, getForeignColumn, getForeignKeyColumns, getForeignKeyRepresentation, getForeignTable, getKeyColumns, getPrimaryKeyColumns, getPrimaryKeyRepresentation, getReferredTable, getTableName, isColumn, isForeignKeyColumn, isKeyColumn, isOptional, isPrimaryKeyColumn, removeColumn, removePrimaryKey, setColumnType, setForeignKey, setForeignKey, setForeignKey, setName, setOptional, setPrimaryKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tableNames

private List tableNames
A List that contains all table names, which are used to specify the SQL statement.


statement

private String statement
The SQL statement.


description

private String description
A description of the view object.

Constructor Detail

View

public View(String name)
Parameters:
name - the name of the view

View

public View(String name,
            String statement,
            List tableNames,
            String description)
Parameters:
name - the name of the view
statement - the SQL statement (is allowed to be null, if it is not of interest)
description - a description of this object (is allowed to be null, if it is not of interest)
Method Detail

setStatement

public void setStatement(String statement)
Parameters:
statement - the SQL statement (is allowed to be null)

setTableNames

public void setTableNames(List tableNames)

getTableNames

public List getTableNames()
                   throws IllegalStateException
Returns:
a List that contains all table names, which are used to specify the SQL statement
Throws:
IllegalStateException - if no table names are specified

getStatement

public String getStatement()
                    throws IllegalStateException
Returns:
the SQL statement
Throws:
IllegalStateException - if no statement is specified

getDescription

public String getDescription()
Returns:
the description of this object
Throws:
IllegalStateException - if no description is specified

toString

public String toString()
Overrides:
toString in class Table
Returns:
a string representation of a view object

Dresden OCL Toolkit

Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.