All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.xmlmiddleware.xmldbms.maps.utils.DDLGenerator

java.lang.Object
   |
   +----org.xmlmiddleware.xmldbms.maps.utils.DDLGenerator

public class DDLGenerator
extends Object
Generate CREATE TABLE strings.

This class generates CREATE TABLE strings that use the following subset of the SQL '92 CREATE TABLE syntax:

    CREATE TABLE table (column type [NOT] NULL [, column type [NOT] NULL...]
       [, CONSTRAINT name PRIMARY KEY (column [, column...])]
       [, CONSTRAINT name UNIQUE (column [, column...])]
       [, CONSTRAINT name FOREIGN KEY (column [, column...])]
             REFERENCES table (column [, column...])]
 

If a DatabaseMetaData object is passed to the constructor, table and column names are checked against the database. (For details, see DBNameChecker.) In addition, database-specific data type names are used. All table and column names use quoted (delimited) identifiers.

Version:
2.0
Author:
Ronald Bourret, 2002

Constructor Index

 o DDLGenerator()
Construct a new DDLGenerator.
 o DDLGenerator(String, DatabaseMetaData)
Construct a new DDLGenerator.
 o DDLGenerator(String[], DatabaseMetaData[])
Construct a new DDLGenerator.

Method Index

 o getCreateTableString(Table)
Gets the CREATE TABLE string for a specific table.
 o getCreateTableStrings(XMLDBMSMap)
Gets CREATE TABLE strings for all tables in the map.

Constructors

 o DDLGenerator
 public DDLGenerator()
Construct a new DDLGenerator.

 o DDLGenerator
 public DDLGenerator(String databaseName,
                     DatabaseMetaData meta) throws SQLException
Construct a new DDLGenerator.

Parameters:
databaseName - The name of the database to which the DatabaseMetaData object applies. If this is null, "Default" is used.
meta - A DatabaseMetaData object.
Throws: SQLException
Thrown if an error occurs retrieving database metadata.
 o DDLGenerator
 public DDLGenerator(String databaseNames[],
                     DatabaseMetaData metas[]) throws SQLException
Construct a new DDLGenerator.

Parameters:
databaseNames - The names of the databases to which the DatabaseMetaData objects apply.
metas - DatabaseMetaData objects.
Throws: SQLException
Thrown if an error occurs retrieving database metadata.

Methods

 o getCreateTableStrings
 public Vector getCreateTableStrings(XMLDBMSMap map)
Gets CREATE TABLE strings for all tables in the map.

Parameters:
map - The map
Returns:
A Vector of CREATE TABLE strings
 o getCreateTableString
 public String getCreateTableString(Table table)
Gets the CREATE TABLE string for a specific table.

Parameters:
table - The table
Returns:
The CREATE TABLE string

All Packages  Class Hierarchy  This Package  Previous  Next  Index