net.sf.dewdrop.sqlml
Class Schema

java.lang.Object
  extended bynet.sf.dewdrop.sqlml.SqlmlComponent
      extended bynet.sf.dewdrop.sqlml.SchemaComponent
          extended bynet.sf.dewdrop.sqlml.Schema

public class Schema
extends SchemaComponent

Author:
Les A. Hazlewood

Field Summary
protected  List schemaComponents
           
 
Fields inherited from class net.sf.dewdrop.sqlml.SchemaComponent
description, name
 
Fields inherited from class net.sf.dewdrop.sqlml.SqlmlComponent
indentLevel, logger
 
Constructor Summary
Schema()
           
 
Method Summary
 void add(SchemaComponent sc)
          Adds a SchemaComponent object to the list of total SchemaComponents that define this schema.
 boolean containsTable(String tableName)
          Returns true if this schema contains a defined table with a name of tableName, false otherwise.
 boolean equals(Object o)
           
 List getComponents()
          Returns a list of all the SchemaComponent objects that make up this schema instance.
 Table getTable(String tableName)
          Returns the table with a name of tableName.
 void onWriteSql(Writer out, Configuration cfg)
           
 
Methods inherited from class net.sf.dewdrop.sqlml.SchemaComponent
getDescription, getName, setDescription, setName
 
Methods inherited from class net.sf.dewdrop.sqlml.SqlmlComponent
getIndentLevel, i18n, i18n, i18n, setIndentLevel, toSql, toSql, toSql, toString, writeSql, writeSql, writeSql
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

schemaComponents

protected List schemaComponents
Constructor Detail

Schema

public Schema()
Method Detail

getComponents

public List getComponents()
Returns a list of all the SchemaComponent objects that make up this schema instance.

Returns:
a list of all SchemaComponent objects

add

public void add(SchemaComponent sc)
Adds a SchemaComponent object to the list of total SchemaComponents that define this schema.

Parameters:
sc -

getTable

public Table getTable(String tableName)
Returns the table with a name of tableName. This method first checks the sysName attribute, and if it does not match, then the name attribute is checked. This method returns null if no table with either a sysName or name matches tableName attributes.

Parameters:
tableName - name to check against
Returns:
the table with sysName or name of 'tableName', or null if no table exists with such a name.

containsTable

public boolean containsTable(String tableName)
Returns true if this schema contains a defined table with a name of tableName, false otherwise.

Parameters:
tableName -
Returns:
tru if this schema contains a table defined with a name of tableName, false otherwise.

equals

public boolean equals(Object o)
Overrides:
equals in class SchemaComponent

onWriteSql

public void onWriteSql(Writer out,
                       Configuration cfg)
Specified by:
onWriteSql in class SqlmlComponent