com.sun.jdo.spi.persistence.generator.database
Class DDLGenerator

java.lang.Object
  extended by com.sun.jdo.spi.persistence.generator.database.DDLGenerator

public class DDLGenerator
extends Object

This class generates DDL for a given SchemaElement.

Author:
Jie Leng, Dave Bristor

Constructor Summary
DDLGenerator()
           
 
Method Summary
static void generateDDL(org.netbeans.modules.dbschema.SchemaElement schema, String dbVendorName, OutputStream createDDLSql, OutputStream dropDDLSql, OutputStream dropDDLJdbc, OutputStream createDDLJdbc, OutputStream dbStream, boolean dropAndCreateTbl)
          Generate DDL from schema and database vendor name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DDLGenerator

public DDLGenerator()
Method Detail

generateDDL

public static void generateDDL(org.netbeans.modules.dbschema.SchemaElement schema,
                               String dbVendorName,
                               OutputStream createDDLSql,
                               OutputStream dropDDLSql,
                               OutputStream dropDDLJdbc,
                               OutputStream createDDLJdbc,
                               OutputStream dbStream,
                               boolean dropAndCreateTbl)
                        throws org.netbeans.modules.dbschema.DBException,
                               SQLException,
                               IOException
Generate DDL from schema and database vendor name. Up to four files containing DDL are created: Furthermore, if the datbase output stream is not null, then create tables in database.

Parameters:
schema - Database schema for which DDL is generated.
dbVendorName - Name of database vendor, which must match one of the names of the .properties files in this package.
createDDLSql - An OutputStream to which human-readable DDL for creating tables gets written.
dropDDLSql - An OutputStream to which human-readable DDL for dropping tables gets written.
dropDDLJdbc - An OutputStream to which DDL for dropping tables gets written. This parameter differs from dropDDLSql because the data written into it is supposed to be used with a JDBC connection.
createDDLJdbc - An OutputStream to which DDL for creating tables gets written. This parameter differs from createDDLSql because the data written into it is supposed to be used with a JDBC connection.
dbStream - DatabaseOutputStream which, if not null, is used to create tables in a live database during this method call.
dropAndCreateTbl - If true, and dbStream is not null, then existing tables are dropped before new ones are created.
Throws:
org.netbeans.modules.dbschema.DBException
SQLException
IOException


Copyright © 2012. All Rights Reserved.