Dresden OCL Toolkit

tudresden.ocl.sql
Class SchemaGenerator

java.lang.Object
  extended bytudresden.ocl.sql.SchemaGenerator
All Implemented Interfaces:
SQLDirector

public class SchemaGenerator
extends Object
implements SQLDirector

Implementation of SQLDirector uses the data provided by an Implementation of the ORMapping interface to generate SQL-scripts for creating database tables according to the SQL DDL provided The actual SQL code depends on the SQLBuilder that must be provided to the SchemaGenerator.

Version:
2.0 (reimplemented a non-startable version, using new features of Tables)
Author:
Andrea Kling
See Also:
SQLBuilder, Table

Field Summary
private  SQLBuilder builder
           
private  ORMapping mapping
           
 
Constructor Summary
SchemaGenerator(ORMapping mapping, SQLBuilder builder)
           
 
Method Summary
 void construct()
          initiates the construction of the SQL script
 String getCode()
          returns the SQL script
 void setBuilder(SQLBuilder builder)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapping

private ORMapping mapping

builder

private SQLBuilder builder
Constructor Detail

SchemaGenerator

public SchemaGenerator(ORMapping mapping,
                       SQLBuilder builder)
Parameters:
mapping - the object relational mapping information
builder - an SQLBuilder providing information on the SQL DDL for construction of SQL scripts
Method Detail

setBuilder

public void setBuilder(SQLBuilder builder)
Specified by:
setBuilder in interface SQLDirector
Parameters:
builder - an SQLBuilder providing information on the SQL DDL for construction of SQL scripts

construct

public void construct()
initiates the construction of the SQL script

Specified by:
construct in interface SQLDirector

getCode

public String getCode()
returns the SQL script

Specified by:
getCode in interface SQLDirector
Returns:
the resulting SQL code from the construction process

Dresden OCL Toolkit

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