|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.architect.ddl.GenericDDLGenerator
ca.sqlpower.architect.ddl.OracleDDLGenerator
public class OracleDDLGenerator
| Field Summary | |
|---|---|
static java.lang.String |
GENERATOR_VERSION
|
| Fields inherited from class ca.sqlpower.architect.ddl.GenericDDLGenerator |
|---|
allowConnection, con, EOL, profileFunctionMap, targetCatalog, targetSchema, topLevelNames, typeMap, warnings |
| Constructor Summary | |
|---|---|
OracleDDLGenerator()
|
|
| Method Summary | |
|---|---|
void |
addColumn(SQLColumn c)
Different from the generic generator because the "COLUMN" keyword is forbidden in Oracle. |
void |
addIndex(SQLIndex index)
create index ddl in oracle syntax |
void |
addTable(SQLTable t)
Overridden to also create sequences if there are auto-increment columns in the table. |
protected void |
createTypeMap()
Creates and populates typeMap using
DatabaseMetaData. |
java.lang.String |
getCatalogTerm()
Returns null because Oracle doesn't have catalogs. |
java.lang.String |
getDeleteActionClause(SQLRelationship r)
Returns the ON DELETE clause for the given relationship, with no extra whitespace or newline characters around it. |
java.lang.String |
getName()
Returns the name of this DDL Generator, which should be a human-readable string with the vendor and/or product name (and version if the generator doesn't work with all versions) of the database platform this generator targets. |
java.lang.String |
getSchemaTerm()
Returns the string "Schema". |
java.lang.String |
getUpdateActionClause(SQLRelationship r)
Only returns the empty string for supported update actions (see supportsUpdateAction(SQLRelationship)), and throws an
IllegalArgumentException if the update rule is not supported. |
boolean |
isReservedWord(java.lang.String word)
Subroutine for toIdentifier(). |
java.lang.String |
makeDropForeignKeySQL(java.lang.String fkTable,
java.lang.String fkName)
Generates a command for dropping a foreign key on oracle. |
void |
modifyColumn(SQLColumn c)
Different from the generic generator because Oracle requires the non-standard keyword "MODIFY" instead of "ALTER COLUMN". |
boolean |
supportsDeleteAction(SQLRelationship r)
Returns true if this DDL generator supports the given relationship's delete action. |
boolean |
supportsRollback()
The generic DDL generator claims to support rollback operation, so specific platforms that don't support it should override this method. |
boolean |
supportsUpdateAction(SQLRelationship r)
Oracle does not support any explicit ON UPDATE clause in FK constraints, but the default behaviour is basically the same as NO ACTION or RESTRICT of other platforms. |
java.lang.String |
toIdentifier(java.lang.String name)
Converts space to underscore in name and returns
the possibly-modified string. |
void |
writeHeader()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String GENERATOR_VERSION
| Constructor Detail |
|---|
public OracleDDLGenerator()
throws java.sql.SQLException
java.sql.SQLException| Method Detail |
|---|
public java.lang.String getName()
DDLGenerator
getName in interface DDLGeneratorgetName in class GenericDDLGeneratorpublic void writeHeader()
writeHeader in class GenericDDLGenerator
protected void createTypeMap()
throws java.sql.SQLException
GenericDDLGeneratortypeMap using
DatabaseMetaData. Subclasses for specific DB platforms will be
able to override this implementation with one that uses a
static, pre-defined type map.
createTypeMap in class GenericDDLGeneratorjava.sql.SQLExceptionpublic boolean isReservedWord(java.lang.String word)
isReservedWord in interface DDLGeneratorisReservedWord in class GenericDDLGeneratorpublic java.lang.String toIdentifier(java.lang.String name)
GenericDDLGeneratorname and returns
the possibly-modified string. This will not be completely
sufficient because it leaves ".", "%", and lots of other
non-alphanumeric characters alone. Subclasses might choose to
quote and leave everything alone, or whatever.
toIdentifier in interface DDLGeneratortoIdentifier in class GenericDDLGeneratorpublic java.lang.String getCatalogTerm()
getCatalogTerm in interface DDLGeneratorgetCatalogTerm in class GenericDDLGeneratorpublic java.lang.String getSchemaTerm()
getSchemaTerm in interface DDLGeneratorgetSchemaTerm in class GenericDDLGenerator
public java.lang.String makeDropForeignKeySQL(java.lang.String fkTable,
java.lang.String fkName)
ALTER TABLE $fktable DROP CONSTRAINT $fkname.
makeDropForeignKeySQL in interface DDLGeneratormakeDropForeignKeySQL in class GenericDDLGeneratorfkTable - The name of the FK table whose relationship should be dropped.fkName - The name of the key to drop.
public void modifyColumn(SQLColumn c)
modifyColumn in interface DDLGeneratormodifyColumn in class GenericDDLGeneratorc - The column to create a MODIFY or ALTER COLUMN statement for.public void addColumn(SQLColumn c)
addColumn in interface DDLGeneratoraddColumn in class GenericDDLGeneratorc - The column to create a ADD statement for.
public void addIndex(SQLIndex index)
throws ArchitectException
addIndex in interface DDLGeneratoraddIndex in class GenericDDLGeneratorindex - The specification of the index to create. Note,
if the index type is STATISTIC, no DDL will be generated because
STATISTIC indices are just artificial JDBC constructs to describe
table statistics (you can't create or drop them).
ArchitectException
public void addTable(SQLTable t)
throws java.sql.SQLException,
ArchitectException
addTable in interface DDLGeneratoraddTable in class GenericDDLGeneratorjava.sql.SQLException
ArchitectExceptionpublic boolean supportsDeleteAction(SQLRelationship r)
GenericDDLGenerator
supportsDeleteAction in class GenericDDLGeneratorpublic java.lang.String getDeleteActionClause(SQLRelationship r)
GenericDDLGeneratorIf you are overriding this method for a platform-specific DDL generator and you need this clause to be empty, return the empty string--not null.
getDeleteActionClause in class GenericDDLGeneratorr - The relationship whose delete action clause to generate
public boolean supportsUpdateAction(SQLRelationship r)
supportsUpdateAction in class GenericDDLGeneratorpublic java.lang.String getUpdateActionClause(SQLRelationship r)
supportsUpdateAction(SQLRelationship)), and throws an
IllegalArgumentException if the update rule is not supported.
getUpdateActionClause in class GenericDDLGeneratorr - The relationship whose update action clause to generate
public boolean supportsRollback()
GenericDDLGenerator
supportsRollback in interface DDLGeneratorsupportsRollback in class GenericDDLGenerator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||