ca.sqlpower.architect.ddl
Class DDLUtils

java.lang.Object
  extended by ca.sqlpower.architect.ddl.DDLUtils

public class DDLUtils
extends java.lang.Object

DDLUtils is a collection of utilities related to creating and executing Data Definition Language (DDL) statements.


Method Summary
static DDLGenerator createDDLGenerator(ca.sqlpower.sql.SPDataSource ads)
           
static java.util.Vector<java.lang.Class<? extends DDLGenerator>> getDDLTypes(ca.sqlpower.sql.DataSourceCollection dsc)
          Finds all DDL Generators configured in the given data source collection.
static java.lang.String toQualifiedName(SQLTable table)
          Returns the appropriate dot-separated fully qualified name for the given table, based on its Schema and Catalog ancestors, if any.
static java.lang.String toQualifiedName(java.lang.String catalog, java.lang.String schema, java.lang.String name)
          Formats the components of a fully qualified database object name into the standard SQL "dot notation".
static java.lang.String toQualifiedName(java.lang.String catalog, java.lang.String schema, java.lang.String name, java.lang.String openQuote, java.lang.String closeQuote)
          Formats the components of a fully qualified database object name into the standard SQL "dot notation", with quote.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toQualifiedName

public static java.lang.String toQualifiedName(SQLTable table)
Returns the appropriate dot-separated fully qualified name for the given table, based on its Schema and Catalog ancestors, if any.

Parameters:
table - The SQLTable instance to get the qualified name of
Returns:
A string of the form:
  • catalog.schema.name if the table has a schema and catalog ancestor
  • catalog.name if the table has a catalog ancestor but no schema
  • schema.name if the table has a schema ancestor but no catalog
  • name if the table has no schema or catalog ancestors
Throws:
java.lang.NullPointerException - if table is null

toQualifiedName

public static java.lang.String toQualifiedName(java.lang.String catalog,
                                               java.lang.String schema,
                                               java.lang.String name)
Formats the components of a fully qualified database object name into the standard SQL "dot notation".

Parameters:
catalog - The catalog name of the object, or null if it has no catalog
schema - The schema name of the object, or null if it has no schema
name - The name of the object (null is not acceptable)
Returns:
A dot-separated string of all the non-null arguments.

toQualifiedName

public static java.lang.String toQualifiedName(java.lang.String catalog,
                                               java.lang.String schema,
                                               java.lang.String name,
                                               java.lang.String openQuote,
                                               java.lang.String closeQuote)
Formats the components of a fully qualified database object name into the standard SQL "dot notation", with quote.

Parameters:
catalog - The catalog name of the object, or null if it has no catalog
schema - The schema name of the object, or null if it has no schema
name - The name of the object (null is not acceptable)
openQuote - openning quote
closeQuote - closing quote
Returns:
A dot-separated string of all the non-null arguments.

getDDLTypes

public static java.util.Vector<java.lang.Class<? extends DDLGenerator>> getDDLTypes(ca.sqlpower.sql.DataSourceCollection dsc)
Finds all DDL Generators configured in the given data source collection.


createDDLGenerator

public static DDLGenerator createDDLGenerator(ca.sqlpower.sql.SPDataSource ads)
                                       throws java.lang.InstantiationException,
                                              java.lang.IllegalAccessException,
                                              java.lang.ClassNotFoundException
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException


Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca