|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.jdbc2xml.schema.impl.DDLHelper
public abstract class DDLHelper
Static helper methods to construct SQL queries for schema manipulations.
Constructor Summary | |
---|---|
DDLHelper()
|
Method Summary | |
---|---|
static java.lang.String |
buildAddColumn(java.lang.String tableName,
ColumnInfo ci,
Dialect dialect,
java.lang.String addColumnCommand)
|
static java.lang.String |
buildAddForeignKey(java.lang.String tableName,
ForeignKeyInfo foreignKeyInfo)
|
static java.lang.String |
buildAddIndex(TableInfo ti,
IndexInfo indexInfo,
boolean allowsMultipleNullsInUniqueIndizes)
|
static java.lang.String |
buildCreateTable(TableInfo ti,
Dialect dialect,
java.lang.String suffix)
Construct a create table statement. |
static java.lang.String |
buildDropColumn(java.lang.String tableName,
java.lang.String columnName)
|
static java.lang.String |
buildDropForeignKey(java.lang.String tableName,
java.lang.String foreignKeyName,
java.lang.String dropForeignKeyCommand)
|
static java.lang.String |
buildDropIndex(java.lang.String tableName,
java.lang.String indexName,
boolean needsOnTableSuffix)
|
static java.lang.String |
buildDropTable(java.lang.String tableName)
Build a drop table statement. |
static java.lang.String |
buildHexSuffix()
|
static java.lang.String |
buildRenameTable(java.lang.String tableName,
java.lang.String newTableName)
Generate a rename table statement. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DDLHelper()
Method Detail |
---|
public static java.lang.String buildCreateTable(TableInfo ti, Dialect dialect, java.lang.String suffix)
ti
- the table information.dialect
- The dialect for creating column specs.suffix
- An RDBMS-specific suffix, which will be appended
after the create table clause.
public static java.lang.String buildDropTable(java.lang.String tableName)
tableName
- The name of the table to drop.
public static java.lang.String buildAddIndex(TableInfo ti, IndexInfo indexInfo, boolean allowsMultipleNullsInUniqueIndizes) throws java.sql.SQLException
ti
- the table information.indexInfo
- The description of the index to be created.allowsMultipleNullsInUniqueIndizes
- Specifies if a UNIQUE INDEX may contain multiple NULL values.
If false, INDEXes for NULLable columns must be created non-UNIQUE.
java.sql.SQLException
- If the index does not contain a name.public static java.lang.String buildDropIndex(java.lang.String tableName, java.lang.String indexName, boolean needsOnTableSuffix) throws java.sql.SQLException
tableName
- The name of the table on which to drop the index.indexName
- The name of the index to drop.needsOnTableSuffix
- Specifies if DROP INDEX needs (or at least allows) the ON tableName suffix
java.sql.SQLException
- If the index does not contain a name.public static java.lang.String buildAddForeignKey(java.lang.String tableName, ForeignKeyInfo foreignKeyInfo) throws java.sql.SQLException
tableName
- The name of the table on which to add a foreign key.foreignKeyInfo
- The description of the foreign key.
java.sql.SQLException
- If the foreign key uses unimplemented features.public static java.lang.String buildDropForeignKey(java.lang.String tableName, java.lang.String foreignKeyName, java.lang.String dropForeignKeyCommand)
tableName
- The name of the table on which to add a foreign key.foreignKeyName
- The name of the foreign key to drop.dropForeignKeyCommand
- The RDBMS-specific command after ALTER TABLE
needed to drop a foreign key.
public static java.lang.String buildAddColumn(java.lang.String tableName, ColumnInfo ci, Dialect dialect, java.lang.String addColumnCommand)
tableName
- the table name.ci
- The description of the column to be created.dialect
- The dialect for creating column specs.addColumnCommand
- The RDBMS specific command after ALTER TABLER
for adding a column.
public static java.lang.String buildDropColumn(java.lang.String tableName, java.lang.String columnName)
tableName
- The name of the table on which to drop the column.columnName
- The name of the column to drop.
public static java.lang.String buildRenameTable(java.lang.String tableName, java.lang.String newTableName)
tableName
- The name of the table which will be renamed.newTableName
- The name of the table after renaming.
public static java.lang.String buildHexSuffix()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |